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: Novice needs help with trigger

Re: Novice needs help with trigger

From: John Roberts <jrobert1_at_netcomuk.co.uk>
Date: 1997/11/22
Message-ID: <01bcf795$f9ec4510$7de52ac2@nsl23ejohn>#1/1

<Mike,

the problem you have is quite common - in fact it is your own trigger that is causing the conflict. I believe that there is a section in the Application Developers Guide about mutating tables which explains the problem and the recommended resolution. Briefly, you aren't allowed to refer to the table which raised the trigger event in the trigger - in your case, a row-level trigger on orat.cpy cannot reference orat.cpy, because Oracle does not know what the table will contain when all row-level triggers have eventually fired. What you will probably need to do is to write away your inerts to a second table (maybe a PL/SQL table ) and apply them via a statement-level trigger.

Hope this helps ( if not - come on back )

John Roberts

Mike Edwards <Mike.Edwards2_at_worldnet.att.net> wrote in article <654foh$9kf_at_mtinsc04.worldnet.att.net>...
> I get the following error when I attempt to execute an insert to a table,
> cpy, which has an after insert trigger defined, COMPANY.
>
> ORA-04091: table ORAT.CPY is mutating, trigger/function may not see it
> ORA-06512: at "ORAT.COMPANY", line 2
> ORA-04088: error during execution of trigger 'ORAT.COMPANY'
>
> It is my understanding that this error would indicate that there is a
> conflict in multiple processes trying to be performed on the table cpy at
> the same time. I have removed all other triggers in the database to
 ensure
> there are no secondary triggers which conflict.
>
>
> Thanks
> Mike.Edwards2_at_Worldnet.att.net
>
>
>
  Received on Sat Nov 22 1997 - 00:00:00 CST

Original text of this message

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