Knowing if after insert trigger fails
How do I know if one of the after insert trigger is failing? I get an error for Before insert trigger if the trigger code is not valid. Does the after insert work开发者_开发知识库s the same way? Is there any way to log the trigger activity?
Oh yes, you can use PRAGMA AUTONOMOUS TRANSACTION to trace all the trigger activities.
The Autonomous Transaction can commit on his own, without affecting the main transaction which fires the trigger.
At the following link:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2212445691154
you can find a detailed example of trigger with an autonomous transaction inside of it.
This is another useful link regarding autonomous transactions:
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/sqloperations.htm#BABDHGAB
精彩评论