Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: mutating table

Re: mutating table

From: Kai Horstmann <horst_at_werum.de>
Date: Tue, 26 Jan 1999 22:01:48 +0100
Message-ID: <36AE2D3C.76815B95@werum.de>


Zachary Agatstein wrote:
>
> Hi,
>
> So, I created an AFTER INSERT ROW as
> the table was declared "mutating", and neither of the two operations
> (inserting new records and deleting old ones) worked.

Hi

You can use a pair of triggers.
One row trigger (... FOR EACH ROW) that puts the Information you need in a message table and a second one on statement level (without ... FOR EACH ROW) (really works!).
The first one fires for each row you process. The second one fires after your statement has completely finished and the tables are no longer mutating.
Here you can do what you want with the changes table, using the information from the message table. If you delete the entries from the message table immediately, no one outside your transaction will ever see a row in the message table.

If you have not so many updated rows you could use a PL/SQL table in a package in memory instead of a real table.

Good luck
Kai Received on Tue Jan 26 1999 - 15:01:48 CST

Original text of this message

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