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

Showing Answers 1 - 7 of 7 Answers

Swathi Yachamaneni

  • Oct 11th, 2006
 

We cant give commit in Trigger.If we want to give commit in Trigger we should use a "AUTONOMOUS TRIGGER".

  Was this answer useful?  Yes

harsh

  • Jan 20th, 2007
 

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.. 


 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.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions