Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: procedure called by trigger can't see new data
tacrawford_at_adelphia.net a écrit :
> The "pragma autonomous_transaction" keeps this from happening. The
> other problem is that while the user updates one record with a
> particular keyfield (name), I need to calculate all records that have
> the same value in the keyfield (name).
>
> Mark D Powell wrote:
> >
> > When you call a procedure from a database table trigger you normally
> > pass the procedure the row data that it is to work with. If you try to
> > work with the table that the trigger is defined on then you will likely
> > end up with a "mutating table" error.
> >
Dear,
Note that the "mutating table " is actually protecting us from nasty mistakes. You may be on a dangereous path if you are trying to circumvent it with an autonomous transaction ...
Tom Kyte discusses the issue at length in his
(highly recommended) books. If you don't have them,
you may want to browse the articles at
http://asktom.oracle.com - search for "mutating table"
You will - notably - find there an article documenting a pattern to achieve your goal.
Regards