Q
Problem solve Get help with specific problems with your technologies, process and projects.

ORA-4091 error with trigger

I have a trigger on a table that has to do an action depending on certain values in the other rows and current row in the table. But I get an ORA-4091 error while doing this. How do I work around this?

I have a trigger on a table that has to do an action depending on certain values in the other rows and current row in the table. But I get an ORA-4091 error while doing this. How do I work around this?
The ORA-4091 is the "mutating trigger" issue and is commonly resolved by abandoning the trigger approach and using a stored procedure instead.

Another option is to use a combination of a "before" trigger to set the context, a row-level trigger to capture the changes to each row, one at a time, and an "after" trigger to apply and commit the changes.

Dig Deeper on Oracle and SQL

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close