Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: mutating table
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
![]() |
![]() |