Home » Developer & Programmer » Forms » how to avoid mutating table error (forms 10g)
how to avoid mutating table error [message #397281] Thu, 09 April 2009 14:56 Go to next message
nastyjillu
Messages: 211
Registered: February 2009
Senior Member
hi,
i have a table 'A'.
i have a on-insert trigger at row level on table 'A'.
in the trigger there is a cursor which queries the same table 'A'.

because of this iam getting mutating table error.

is there any way to avoid this error without having to change the code in the trigger?

i know that i using PRAGMA AUTONOMOUS_TRANSACTION is one way to avoid the error. but my leader doesnt want me to use it.

is there any other way??

can using pragma autonomous_transaction be harmfull in anyway??

iam inserting through forms application and unable to insert.
then i inserted using insert command in database and found the error.

thanks
jillu
Re: how to avoid mutating table error [message #397314 is a reply to message #397281] Fri, 10 April 2009 00:59 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
SQL & PL/SQL forum is full of mutating tables questions (and answers). Did you review those topics (especially older ones, as newer most often ask you to search for previous discussions)?

Instead of searching for a solution of the mutating table error, perhaps you could revise your design and adjust it so that it doesn't cause such problems.

Otherwise, check what good INSTEAD OF triggers make to it; perhaps this approach helps.
Re: how to avoid mutating table error [message #397429 is a reply to message #397314] Fri, 10 April 2009 11:31 Go to previous messageGo to next message
nastyjillu
Messages: 211
Registered: February 2009
Senior Member
Ok.

thanks
jillu
Re: how to avoid mutating table error [message #397740 is a reply to message #397281] Mon, 13 April 2009 12:26 Go to previous messageGo to next message
jagadeeshg
Messages: 14
Registered: December 2007
Location: BLR
Junior Member

Change in design can help you acheive this.
Eg: use package to pass the result set of cursor pre-insert
and refer the result set in on-insert trigger.

Hope this will help
Re: how to avoid mutating table error [message #398370 is a reply to message #397281] Thu, 16 April 2009 02:13 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
The 'on-' triggers are typically used for non-Oracle databases. Consider using the 'pre-' or maybe 'post-' triggers. Also consider whether the work should be done at the database instead of the form level.

David
Previous Topic: unable to Save Value of Formula or summary
Next Topic: MMB compiled in version 9.0 not wotking in forms6i
Goto Forum:
  


Current Time: Sat Dec 03 12:23:03 CST 2016

Total time taken to generate the page: 0.19943 seconds