Home » SQL & PL/SQL » SQL & PL/SQL » Mutating trigger error
Mutating trigger error [message #309725] Fri, 28 March 2008 10:31 Go to next message
shivaram9
Messages: 35
Registered: August 2006
Member
Hi All,

I have a peculiar scenario where i am getting mutating trigger error.

I have table A, when this table A is updated an After update on row will fire and update a table B, then another trigger After update row level will fire on B and calls a package which will query table A (this is where i am getting mutating trigger error).

Can some one throw some light or ideas as to how i can go around with this mutating trigger issue.

One work around is
1. Global temporary table or pl/sql table
i can store the table A values in global temporary table and use it instead of query on table A, but this will be helpful when table A is updated, what if table B is updated alone and we would be looking at global temporary table for values from table A which there wont be as we did not store.

Thanks,
Shiva
Re: Mutating trigger error [message #309733 is a reply to message #309725] Fri, 28 March 2008 11:07 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Mutating table errors are VERY well documented.
That means this is not an expert question.
Re: Mutating trigger error [message #309734 is a reply to message #309725] Fri, 28 March 2008 11:07 Go to previous message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
This error has so many times been asked that it is no more an expert question (if it ever was).

Your design is bad, if you have a complex things to do on update then call a procedure that does the job and do not use triggers.

Regards
Michel
Previous Topic: sql DataType
Next Topic: Problem Group by command
Goto Forum:
  


Current Time: Sat Feb 15 13:15:02 CST 2025