Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Need help writing a trigger
Have you tried changing the trigger to be a before delete rather than an after delete ? Since failure of trigger processing in either case will cause a rollback this should not cause integrity problems.
I have 2 tables involved in a trigger (currently on Interbase). The trigger goes something like this ...
create trigger test
after delete on A
for each row
begin
update B
set status = 'X'
where code = (select code from A tab_a
where tab_a.code = :old.code and tab_a.mydate <= sysdate);
end;
code is the primary key on B, but not on A
Obviously, this trigger causes errors (table mutating). I'm
wondering if there is a smart way around this. I cannot re-engineer
the tables.
--
kshave_at_minet.gov.mb.ca Received on Thu Mar 06 1997 - 00:00:00 CST