When the mutating error will comes? and how it will be
resolved?

Answers were Sorted based on User's Feedback



When the mutating error will comes? and how it will be resolved?..

Answer / chandu

when we try to dml operation on orginal table in trigger.
then the trigger was excuted but while perfoming any action
on original table it will show mutating..

to overcome the above problem we need to create a autonamous
trasaction trigger..

Is This Answer Correct ?    9 Yes 1 No

When the mutating error will comes? and how it will be resolved?..

Answer / 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

More SQL PLSQL Interview Questions

How we can update the view?

0 Answers  


Write a query to get 2nd maximum salary in an employee table ?

69 Answers   Accenture, BirlaSoft, Letse, Logica CMG, Qwest, Rheal Software, Saagam, Semantic Space, Tailor Solution, TCS, TinyERP,


How is Oracle 10g helpful when compared to oracle 9i and what is grid computing

1 Answers   Flextronics,


How does sql*loader handles newline characters in a record? : aql loader

0 Answers  


what is the difference between granting and creating a view?

2 Answers  






what is the difference between trigger and constraint?

3 Answers   HSBC,


What is a database trigger?

0 Answers  


What is mutating error in pl sql?

0 Answers  


Is there any restriction on the use of union in embedded sql?

0 Answers  


Write a simple program on cursors

2 Answers   BirlaSoft,


how to connect oracle in unix prompt?

4 Answers   Polaris,


What is structural independence and why is it important?

0 Answers  


Categories