Home » SQL & PL/SQL » SQL & PL/SQL » commit inside a trigger (merged 3)
commit inside a trigger (merged 3) [message #364598] Tue, 09 December 2008 04:21 Go to next message
Messages: 24
Registered: October 2007
Location: Bangalore
Junior Member

Why it is not possible to commit inside a non-autonomous trigger
Re: commit inside a trigger [message #364606 is a reply to message #364598] Tue, 09 December 2008 04:29 Go to previous messageGo to next message
Messages: 6
Registered: November 2006
Location: India
Junior Member

Because trigger are procedural code that gets executed when a event like INSERT, UPDATE or DELETE happens.

So we can consider them as a part of a open transaction. And hence we cant commit in between the transaction.

Let say you have a insert trigger. You insert a record and your trigger gets fired. Now the trigger updates a table and commits. Now outside the trigger that is in the main process a error occurs. So you want to rollback your insert. But as you have committed inside the trigger that will not be possible.

And this is the reason for which oracle does not allow you to commit inside a trigger.

Re: commit inside a trigger (merged 3) [message #364619 is a reply to message #364598] Tue, 09 December 2008 05:15 Go to previous message
Michel Cadot
Messages: 65085
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Once again STOP repeating your question.
I deleted the last one and will do it with the next ones with the same question.

Previous Topic: how to fix ORA-00904 Error
Next Topic: compnent "gettimeband" must be declared
Goto Forum:

Current Time: Mon Jul 24 22:10:57 CDT 2017

Total time taken to generate the page: 0.11802 seconds