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

What is the difference between a subquery and a join?

523


Can we create clustered index without primary key?

518


What is the difference between microsoft access and sql server?

527


What is the basic form of sql query?

489


What is sqlerrm?

540






Can triggers stop a dml statement from executing on a table?

610


Explain foreign key in sql?

619


Is keyword pl sql?

556


What is sql*loader and what is it used for?

571


How can I make sql query run faster?

555


What are the different types of constraints?

559


What is t-sql? : Transact sql

534


How show all rows in sql?

604


How do you add a column to a table?

594


Explain dml and ddl?

543