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


Please Help Members By Posting Answers For Below Questions

Why cross join is used?

825


how can we optimize or increase the speed of a mysql select query? : Sql dba

689


When should I use nosql database?

728


Is join an inner join?

718


What is sql integrity?

784






Can we rollback truncate?

719


Show how functions and procedures are called in a pl/sql block.

766


How do you use collections in procedure to return the resultset?

2000


What is raw datatype in sql?

725


How does index help in query performance?

761


what are the authentication modes in sql server? : Sql dba

732


How do you write an inner join query?

692


Is left join inner or outer?

759


how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba

690


Can we insert data into view?

680