how instead of triger is helpful for mutating tables errors
handlling ?

Answers were Sorted based on User's Feedback



how instead of triger is helpful for mutating tables errors handlling ?..

Answer / guru

"Mutating" means "changing". A mutating table is a table
that is currently being modified by an update, delete, or
insert
statement. When a trigger tries to reference a table that is
in state of flux (being changed), it is considered
"mutating" and
raises an error since Oracle should not return data that has
not yet reached its final state.
Another way this error can occur is if the trigger has
statements to change the primary, foreign or unique key
columns of the
table off which it fires. If you must have triggers on
tables that have referential constraints, the workaround is
to enforce the
referential integrity through triggers as well.
There are several restrictions in Oracle regarding triggers:
• A row-level trigger cannot query or modify a
mutating table. (Of course, NEW and OLD still can be
accessed by the
trigger) .
• A statement-level trigger cannot query or modify a
mutating table if the trigger is fired as the result of a
CASCADE delete.

So some time we can not use triggers to put DMl operations
on table. that time we can use INSTEAD OF TRIGGER.

Is This Answer Correct ?    7 Yes 0 No

how instead of triger is helpful for mutating tables errors handlling ?..

Answer / mahesh

create a view (simple view) on mutating table

write a tigger on view (define similar to table)


Know try to do dml operations on table

it will not show the mutating error

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

What operators deal with null?

0 Answers  


What are the benefits of triggers?

0 Answers  


What is the source code of a program?

0 Answers  


Does group by remove duplicates?

0 Answers  


What is count * in sql?

0 Answers  






How to revise and re-run the last sql command?

0 Answers  


How can check sql version from command line?

0 Answers  


State the difference between implict and explict cursor's?

7 Answers   CTS,


Is a foreign key always unique?

0 Answers  


What is union?

0 Answers  


Write the sql query using dual table for below output? 1 L R --- --- ---- 1 1 1 1 2 1 1 3 1 1 1 2 1 2 2 1 3 2 1 1 3 1 2 3 1 3 3 Write a query using only Dual table with out writing any pl/sql program.

3 Answers   JPMorgan Chase,


Can you have a foreign key without a primary key?

0 Answers  


Categories