'insert or update trigger' to update the same table
Date: 23 Aug 2001 07:01:02 -0700
Message-ID: <31d3e92a.0108230601.7da29041_at_posting.google.com>
Hi!
Maybe it's just a simple problem for some of you, but I really desparate to find the solution.
This is my trigger
CREATE OR REPLACE TRIGGER OBJ
BEFORE INSERT OR UPDATE ON OBJ
FOR EACH ROW
BEGIN
update OBJ
set OBJ.DESCR=to_char(sysdate)
where status=true and serial=:new.serial
END;
I get an error that the table is mutating.
I know the reason of this error, but I can't find any other solution.
I think I have to use row level trigger since I have to know the
serial from the row which is updated or inserted.
I've tried to create a view and then an INSTEAD OF TRIGGER, but I always get an error which said that my trigger is invalid (I use TOAD to write my trigger)
Thank you in advance!!
sien Received on Thu Aug 23 2001 - 16:01:02 CEST