Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Oracle Trigger Problem
I am new to Triggers...
I have two oracle triggers the first trigger (which works fine) simply copies records from table ttdilc501795 to my table (ttdobg501795). The second trigger is an update trigger that is supposed to update only two fields (t$cstk and t$cstr) in my table when they are modified in the original original. The problem is that the trigger updates the fields for all records in my table. How do I fix this?
CREATE OR REPLACE TRIGGER CYCLECOUNT
BEFORE UPDATE ON ttdilc501795
FOR EACH ROW
WHEN (new.t$cstk <> old.t$cstk
OR new.t$cstr <> old.t$cstr)
DECLARE
ws_cstk number(16,4); ws_cstr number(16,4); BEGIN ws_cstk := :new.t$cstk; ws_cstr := :new.t$cstr;
t$cstr = ws_cstr
WHERE :new.t$orno = :old.t$orno
AND :new.t$sern = :old.t$sern
AND :new.t$item = :old.t$item;
END; /
Any suggestions would be greatly appreciated! Received on Wed Jul 23 2003 - 14:34:24 CDT
![]() |
![]() |