Re: Mutating Tables!!!
Date: 1998/02/26
Message-ID: <6d4h5b$2850$1_at_rtpnews.raleigh.ibm.com>#1/1
Avinash,
I'd like to piggyback onto this conversation if I may. I have two tables that have a parent-child relationship. I have an after-update trigger on the parent, and a before insert-update trigger on the child. In the after-update on the parent, I run an SQL UPDATE statement against the child. The before insert-update trigger on the child needs to read some of the values from the updated row of the parent. When I execute an update on the parent, I get the following errors:
ORA-04091: table ACCOUNT_MASTER is mutating, trigger/function may not see it
ORA-06512: at "ACCTDET_BEF_UPD_INS_ROW", line 14 ORA-04088: error during execution of trigger 'ACCTDET_BEF_UPD_INS_ROW' ORA-06512: at "ACCTMAS_AFT_UPD_ROW", line 2 ORA-04088: error during execution of trigger 'ACCTMAS_AFT_UPD_ROW'
What I'm not understanding about this is that the master has an ** AFTER ** update trigger. Shouldn't all the mutating be done by now?
Avinash Deshpande <avdeshpa_at_cisco.com> wrote:
>Hi,
>Mutating tables are as the name suggests..toggle tables.
>If you are trying to write a database trigger on a table and are trying
>to access the same table in the trigger body then this is a case of
>mutation..
>The trigger will fire on that table but when the trigger tries to access
>the table..it kindda gets a dead-lock.
>Avinash
>JAYABH wrote:
>>
>> Dear Gurus,
>> Could anyone one of you please let me know what Mutating tables are!!.
>> If possible please do give me some example.
>>
>> Thanks a lot in advance.
>> Regards,
>> Tushar
Received on Thu Feb 26 1998 - 00:00:00 CET
