What is mutating trigger?How to avoid it??
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
How insert into statements in sql?
Can I join the same table twice?
What is a common use of group by in sql?
what is global temporary tables and how use that tables in pl/sql packages
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....
What are the types pl/sql code blocks?
How would you reference column values before and after you have inserted and deleted triggers?
What are sql injection vulnerabilities?
Which one is better subquery or joins?
How much does a sql dba make? : SQL DBA
What are all the ddl commands?
how to drop an existing table in mysql? : Sql dba