how instead of triger is helpful for mutating tables errors
handlling ?
Answer Posted / 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 |
Post New Answer View All Answers
How to know the last executed procedure?
What is the maximum rows in csv?
What is hibernate and its relation to sql?
Why do we go for stored procedures?
Explain table and field in sql?
What is the difference between a database and a relational database?
write an sql query to get third maximum salary of an employee from a table named employee_table. : Sql dba
Which certification is best for sql?
Can function return multiple values in sql?
Can we join 3 tables in sql?
How many types of relationship are there?
Why are sql stored procedures used?
what is bcp? When does it used? : Sql dba
Can we join two tables without common column?
What is record data type?