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 -> a simple Trigger question

a simple Trigger question

From: Joseph Chang <chinastorm_at_bigfoot.com>
Date: Thu, 18 Nov 1999 15:01:51 +0800
Message-ID: <8107nr$1sa1$1@news.cz.js.cn>


 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

Original text of this message

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