What is mutating trigger?How to avoid it??

Answers were Sorted based on User's Feedback



What is mutating trigger?How to avoid it??..

Answer / surendra reddy

Mutaing error happens with triggers. It occurs because the
trigger is trying to update a row it is currently using.
The usual fix involves either use of views or temporary
tables so the database is selecting from one while updating
the other.

Is This Answer Correct ?    13 Yes 4 No

What is mutating trigger?How to avoid it??..

Answer / muthukumar

In trigger when selection and insertion or updation in same
table that time the MUTATING TRIGGER occurs.
U CAN AVOID THAT PROBLEM USE Autonomous transactions .

Is This Answer Correct ?    7 Yes 2 No

What is mutating trigger?How to avoid it??..

Answer / megha bidve

Use autonomous transactions because is it we can use commit
inside the trigger.

Autonomous transactions allow you to leave the context of
the calling transaction, perform an independant
transaction, and return to the calling transaction without
affecting it's state. The autonomous transaction has no
link to the calling transaction, so only commited data can
be shared by both transactions.

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

How are multiple column = value pairs delimited in the SET clause of an UPDATE statement? 1. With commas (SET price = 0, status = 'I') 2. With parentheses (SET (price = 0) (status = 'I')) 3. With double-pipes (SET price = 0 || status = 'I') 4. With square-brackets (SET [price = 0] [status = 'I'] 5. With single or multiple spaces (SET price = 0 status = 'I')

2 Answers  


when normalization is required

3 Answers   HCL,


What are sql ddl commands?

0 Answers  


Write one update command to update seqno field of a table on the basis of row number.

4 Answers   HCL,


Can you join a table to itself?

0 Answers  






Question: Below is the table city gender name delhi male a delhi female b mumbai male c mumbai female d delhi male e I want the o/p as follows: male female delhi 2 1 mumbai 1 1 Please help me in writing the query that can yield the o/p mentioned above?

2 Answers  


How do I install microsoft sql?

0 Answers  


What is difference between db2 and sql?

0 Answers  


Which one is better subquery or joins?

0 Answers  


What is intersect?

1 Answers  


What is a call statement? Explain with an example.

0 Answers  


i need department wise top 2 employees salary.which logic i will use

17 Answers  


Categories