Suppose I have 2 triggers on table T, tr1- a before insert trigger & tr2- a before update trigger.tr1 has update (T) statement inside body of tr1andtr2 has insert (T) statement inside body of tr2Now, I'm tring to insert a row into T.What will hppn??

Questions by shamim909   answers by shamim909

Showing Answers 1 - 1 of 1 Answers

Bavani

  • Oct 13th, 2006
 

You will get a mutating table error.

because you cannot do any DML statements inside the trigger which is used by the same table you are updating or inserting.

trupti

  • Feb 13th, 2007
 

Hi, you can use pragma autonomous_transaction for mutating trigger ie after declare, the first statement is pragma autonomous_transaction.
try it,
it really works!!

gkbiswal

  • Oct 21st, 2007
 

It(autonomous transaction) will work but it'll not satisfy your business requirement. Mutating error is not actually an error but Oracle has provided this feauture to do away with any side effects due to the bad application design. Therefore mutaing rror means, sometning is wrong with the application design.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions