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
Why cross join is used?
how can we optimize or increase the speed of a mysql select query? : Sql dba
When should I use nosql database?
Is join an inner join?
What is sql integrity?
Can we rollback truncate?
Show how functions and procedures are called in a pl/sql block.
How do you use collections in procedure to return the resultset?
What is raw datatype in sql?
How does index help in query performance?
what are the authentication modes in sql server? : Sql dba
How do you write an inner join query?
Is left join inner or outer?
how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba
Can we insert data into view?