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 are the different operators available in sql?

0 Answers  


How can you fetch common records from two tables?

0 Answers  


how i do the database testing of online money transactions between two parties (client and organization). suppose our company makes a website for our client and give a extra feature of online money transaction with there clients then how i test this feature in database testing

1 Answers  


How can you save or place your msg in a table?

0 Answers  


What is schema in sql example?

0 Answers  






how can i create a user defined datatype

3 Answers  


Is oracel sql developer written in java?

0 Answers  


Is inner join faster than left join?

0 Answers  


What is denormalization in a database?

0 Answers  


Does sql*plus have a pl/sql engine?

0 Answers  


What is oracle ? why we should go for oracle database instead of diffrent databases available in the industry.

5 Answers   Polaris,


What is the reports view in oracle sql developer?

0 Answers  


Categories