Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle Triggers
In article <3576ec5e.0_at_news.cadvision.com>,
"Terry Dykstra [TeamPS]" <no_spam_tdykstra_at_cfol.ab.ca> wrote:
>
> Yes, you can. Most likely you will get a 'mutating table' error when you do
> the insert in the same trigger as the update. To get around that, you defer
> the insert into an 'after update' trigger. You will need a package in the
> trigger to 'hide' the insert from Oracle.
>
> --
> Terry Dykstra [TeamPS]
> Canadian Forest Oil Ltd.
> GlennThames_at_my-dejanews.com wrote in message
> <6l6nji$rgs$1_at_nnrp1.dejanews.com>...
> >I am writing an update Trigger and need to insert a row into the same table
> >that initiated the trigger. Can I do this in Oracle? If I can, How?
> Thanks.
> >
> >-----== Posted via Deja News, The Leader in Internet Discussion ==-----
> >http://www.dejanews.com/ Now offering spam-free web-based newsreading
>
>
Terry, I really appreciate your response. I built a package with a procedure that actually does the insert and called the procedure from the after update trigger. I recieved the following error:
ERROR at line 1: ORA-04091: table SUNTRACK.EFIS_TMP_ADDRS is mutating, trigger/function may not s ORA-06512: at "SUNTRACK.CREATEOLDADDRPKG", line 5 ORA-06512: at "SUNTRACK.CREATEOLDADDR_AU", line 2 ORA-04088: error during execution of trigger 'SUNTRACK.CREATEOLDADDR_AU'
Do you have any ideas on what I may be doing wrong?
-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Mon Jun 08 1998 - 13:12:34 CDT