GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  PL/SQL
Go To First  |  Previous Question  |  Next Question 
 PL/SQL  |  Question 233 of 241    Print  
TCL Statements in Trigger
Why are we not supposed to include TCL statements in a trigger?


  
Total Answers and Comments: 4 Last Update: June 16, 2009     Asked by: bmsrao 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: srinivas_oracle
 
Directly we cannot give TCL commands in triggers. But by using pragma autonomous_transaction we can give TCL commands in triggers.
hope this answer satisfies you.

Above answer was rated as good by the following members:
bmsrao, neelapu
September 07, 2008 11:49:49   #1  
srinivas_oracle Member Since: September 2008   Contribution: 1    

RE: TCL Statements in Trigger
Directly we cannot give TCL commands in triggers. But by using pragma autonomous_transaction we can give TCL commands in triggers.
hope this answer satisfies you.

 
Is this answer useful? Yes | NoAnswer is useful 2   Answer is not useful 0Overall Rating: +2    
March 26, 2009 01:42:54   #2  
bharadwaj.uma Member Since: March 2009   Contribution: 2    

RE: TCL Statements in Trigger
A Trigger may not issue any transactional control statements-COMMIT ROLLBACK or SAVEPOINT. The trigger is fired as part of the execution of the triggering statement and is in the same transaction as the triggering statement. When the triggering statement is committed or rollback the work in the trigger is committed or rollback as well.
 
Is this answer useful? Yes | No
April 03, 2009 03:05:22   #3  
lekurwale Member Since: April 2009   Contribution: 1    

RE: TCL Statements in Trigger
We cannot use TCL like commit or rollback in Triggers but by using Pragma_autonoumous Transaction we can use the same.
 
Is this answer useful? Yes | No
June 16, 2009 19:51:37   #4  
Vansat Member Since: June 2009   Contribution: 2    

RE: TCL Statements in Trigger
We cannot use TCL statements in triggers because using them violates the integrity of the transaction. But if we want TCL statements to be used in triggers then that can be implemented by using Autonomous i.e. by providing PRAGMA AUTONOMOUS_TRANSACTION in the beginning of the trigger. We can use these types of triggers to maintain log details of a table.
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape