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 insert into statements in sql?

0 Answers  


Can I join the same table twice?

0 Answers  


What is a common use of group by in sql?

0 Answers  


what is global temporary tables and how use that tables in pl/sql packages

1 Answers   Cap Gemini,


declare v_count number(8,3); v_sal scott.emp.sal%type := '&P_sal'; cursor cur_name is select sal from scott.emp where sal between (v_sal-100) and (v_sal +1000); begin v_count :=nvl(sql%rowcount ,0); if v_count = 0 then dbms_output.put_line('no records are fetch in the given sal range'); else dbms_output.put_line('There is/are '||to_char(v_count)|| ' salaries are selected in the given range '); end if; end; in the above programm .....for any sal range ....always it shows the following message.. no records are fetch in the given sal range please find the mistake and share with me...with thansk and regards..sarao....

3 Answers   Satyam,






What are the types pl/sql code blocks?

0 Answers  


How would you reference column values before and after you have inserted and deleted triggers?

0 Answers  


What are sql injection vulnerabilities?

0 Answers  


Which one is better subquery or joins?

0 Answers  


How much does a sql dba make? : SQL DBA

0 Answers  


What are all the ddl commands?

0 Answers  


how to drop an existing table in mysql? : Sql dba

0 Answers  


Categories