Search code examples
oracletriggersupdatesmutating-table

In which trigger error occured -oracle mutating error


In live environment there is a screen which is used to authorize the transaction, during the authorisation, data will be update in the table T1. This screen working with no issue, suddenly user told there is an error is throwing during authorization. ORA-04091: table schema.T1 is mutating, trigger/function may not see it. That's it. The error doesn't show up in which trigger has error occurred. I have tested in my local environment doesn't get any error. I think it will be a data issue but how to identifiy in which trigger it has occurred. I have checked all the triggers of T1, actually those triggers working for long since this issue occur. Normally the error will show up which trigger error occurred but it doesn't shows up. Is it possible to trace?


Solution

  • Error stack contains that info already; ask user to provide it.

    For example, that's how it looks like:

    ORA-04091: table SCOTT.EMP is mutating, trigger/function may not see it
    ORA-06512: at "SCOTT.TRG_BUD_EMP", line 12
    ORA-04088: error during execution of trigger 'SCOTT.TRG_BUD_EMP'