When the mutating error will comes? and how it will be
resolved?
Answers were Sorted based on User's Feedback
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 |
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 |
What is the use of sql trace?
Why schema is used in sql?
What is a recursive join sql?
What is localdb mssqllocaldb?
How many sectors are in a partition?
What is trigger in pl sql?
What is normalization in sql?
what is self-join? : Sql dba
What do you think about pl/sql?
What is rollback?
What is over () in sql?
Can we declare a column having number data type and its scale is larger than pricesionex: column_name number(10,100),column_name numbaer(10,-84)
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)