GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Database
Go To First  |  Previous Question  |  Next Question 
 Database  |  Question 28 of 70    Print  
Can i write commit in trigger? not then? why i cant write commit in trigger?

  
Total Answers and Comments: 3 Last Update: April 25, 2008     Asked by: Santosh 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
October 11, 2006 07:15:03   #1  
Swathi Yachamaneni        

RE: Can i write commit in trigger? not then? why i can...
We cant give commit in Trigger.If we want to give commit in Trigger we should use a AUTONOMOUS TRIGGER .
 
Is this answer useful? Yes | No
January 20, 2007 09:30:24   #2  
harsh        

RE: Can i write commit in trigger? not then? why i can...

since we know -

triggers r statement that r executed automatically as sideeffect of data modification.

therefore we can not write commit in triggers..

but we write for data security..


 
Is this answer useful? Yes | No
April 25, 2008 03:11:19   #3  
Kanhucharan Member Since: March 2008   Contribution: 4    

RE: Can i write commit in trigger? not then? why i cant write commit in trigger?

As trigger is implicitly fired u can not commit.Here I m giving one example. Let u wrote a trigger for inserting 100 records And after that U wrote commit When the particular event occures the trigger will fired At the time of record inserting let the power is gone away so as u gave commit statement the no. of records should have inserted before power cut but rest of records will not inserted. I think r8 now U could understand the disadvantages of writing commit or rollback in the trigger body.

 
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