When the mutating error will comes? and how it will be
resolved?
Answer Posted / pravin more
Mutating error in Trigger:-
When programmer create trigger and give table name abc and
in body if programmer is using same table abc for
selecting,updating,deleting,inserting then mutation occur.
ex.:-
create or replace trigger xyz
after
update
on abc
for each row
referencing :OLD as OLD :NEW as NEW
begin
select max(salary) from abc;
update abc
set location_id=:NEW.location_id
where dept_id=105;
end;
------------------------------------------------------------
In the above example you are updating same table which is
under transaction so mutation problem occur here.
Solution on this is
You can use Temporary table or Materialize view which can
solve above problem
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What are its different types of dbms?
how to load data files into tables with 'mysqlimport'? : Sql dba
Can we use ddl statements in stored procedure?
Why stored procedure is faster than query?
What are pl/sql cursors?
What is sql*plus?
how to select unique records from a table? : Sql dba
what is the difference between char and varchar data types? : Sql dba
How does index help in query performance?
How can the performance of a trigger be improved?
Can we insert data into materialized view?
difference between anonymous blocks and sub-programs.
What is difference between ms sql and mysql?
What is pragma in sql?
what are all the different types of indexes? : Sql dba