Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Need help writing a trigger

Re: Need help writing a trigger

From: L120bj <l120bj_at_aol.com>
Date: 1997/03/06
Message-ID: <19970306003201.TAA17135@ladder01.news.aol.com>#1/1

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.




Subject: Need help writing a trigger
From: kshave_at_MBnet.MB.CA (Keith S.)
Date: 4 Mar 97 21:50:41 GMT
Message-ID: <kshave.857512241_at_access>

        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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US