Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create Trigger to Delete from multiple tables

656867Sep 18 2008 — edited Sep 19 2008
Hello:

I'm trying to write a trigger which will allow me to delete from multiple records. I have two tables where the record for the same client_id needs to be deleted.

Is it possible to do this? I started writing some code and this is what I have so far:
create or replace trigger app_t1
before delete on <table1> ?? - 
for each row
begin
delete from client where clientid = :new.clientid;
delete from key where pk = :newclientid;
end;
I'm stuck on the line where I have "before delete on" where I'm supposed to provide a table name. I can only use one table and I need to delete from two.

This trigger is supposed to be used within APEX. In APEX, fields are designated as :P1_clientid where P1 references page 1 of the application. Yet, :P1_clientid is set to the field clientid in the table.

So when I write my trigger, I'm not sure how I'm supposed to set my variables.

Can someone help?

I'm also going to post this into the APEX forum.

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 17 2008
Added on Sep 18 2008
4 comments
1,008 views