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: Database trigger table issue.

Re: Database trigger table issue.

From: WvA <wesselX_at_wau.misX.ah.nl>
Date: Tue, 21 Apr 1998 08:26:56 GMT
Message-ID: <Err8ov.G20@wau.mis.ah.nl>

Alan D. Mills wrote in message <6hfmc3$dpn$1_at_schbbs.mot.com>...
>I have a database trigger which fires on update of all records of a
specific
>table (say TABLEA). What I actually wish to do is to perform more DML on
>the same table within the trigger.
>
>I get error 4091 "Table owner.tablea is mutating". It seems I cannot
>reference tablea from anywhere within the trigger firing from it.
>
>Is there a work around for this?
>
>--
>Alan D. Mills
>
>To email remove NOSPAM from address.
>
>

What you could do is to write 3 database triggers and a package instead. In the package you should maintain a pl/sql table in which you can save for example the rowid of each row you're updating. Create a before-statement trigger that calls a procedure in the package that initializes the pl/sql table and sets the index on that table to 1. Create an after-update trigger that calls a procedure in the package that will save the current rowid into the pl/sql table. Create an after-statement trigger that calls a procedure that processes each row from the pl/sql table and performs the additional DML you wanted.

--
Wessel van Alphen.
Please remove all X's from my E-mail account when replying. Received on Tue Apr 21 1998 - 03:26:56 CDT

Original text of this message

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