Q

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.

This was last published in October 2005

Dig Deeper on Oracle and SQL

PRO+

Content

Find more PRO+ content and other member only offers, here.

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.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close