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?

    Requires Free Membership to View

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 first published in October 2005

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
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
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: