Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> a simple Trigger question
Hi everybody!
i am a pl/sql beginner. i have a prblem about trigger. the temp table looks like that
col1(number) col2 (number)when i insert a new record to this table, the col2 should be col1+1000 . i try the trigger like that:
create or replace trigger firea
after insert on temp
for each row
declare
temp_col1 temp._col1%type;
begin
update temp set col2=:new.col1+1000 where col1= :new.col1;
end firea;
it compile ok, but when i insert a record to temp , the oracle said
ORA-04091: table SM.TEMP is mutating, trigger/function may not see it ORA-06512: at "SM.FIREA", line 4 ORA-04088: error during execution of trigger 'SM.FIREA'
any tip for solve the problem by change this trigger? Received on Thu Nov 18 1999 - 01:01:51 CST