View Single Post
  #9 (permalink)  
Old 05-11-09, 11:07
chuck_forbes chuck_forbes is offline
Registered User
 
Join Date: Dec 2003
Posts: 1,072
If you keep things the way you have them, you can use a package spec variable as a global variable to determine where the DELETE call is coming from.

I've seen this done with a stack with the TRIGGER name in it.

Code:
create trigger table1_bt
before delete
on table1
for each row
  my_name varchar2(30) := 'TABLE1_PG';
begin
  if stack_pg.in_stack('TRIGGERS', my_name) then
    return;
  end if;

  stack_pg.push('TRIGGERS', 'table1_bt');

  delete 
  from table2
  where some_field = :OLD.some_field;

  stack_pg.pop('TRIGGERS', 'table1_bt');
  
exception
  when others then
     stack_pg.destroy('TRIGGERS');
  
end table1_bt;
Reply With Quote