Home » Other » Training & Certification » how to use commit statement inside a trigger
how to use commit statement inside a trigger [message #298624] Wed, 06 February 2008 19:31 Go to next message
ryuva4u
Messages: 2
Registered: February 2008
Junior Member
how to use commit while executing a trigger?
Re: how to use commit statement inside a trigger [message #298626 is a reply to message #298624] Wed, 06 February 2008 19:35 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Did you search the forum?

By
Vamsi
Re: how to use commit statement inside a trigger [message #298651 is a reply to message #298624] Thu, 07 February 2008 00:22 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
You don't commit inside a trigger.

Regards
Michel
Re: how to use commit statement inside a trigger [message #298660 is a reply to message #298624] Thu, 07 February 2008 00:59 Go to previous messageGo to next message
raj1222
Messages: 5
Registered: February 2008
Location: hyd
Junior Member
hai,

In triggers we dont use any transactional control statements.

commit,rollback will not work in triggers.
Re: how to use commit statement inside a trigger [message #298666 is a reply to message #298660] Thu, 07 February 2008 01:19 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
There are cases when committing in a trigger is justified. For example, error logging is one of these cases. Scenario: user performs an illegal operation which is to be rolled back. Autonomous transaction trigger will save (commit) error information into the error log table, whilst the main transaction data is rolled back.

Here's an example (a screenshot, to emphasize different sessions):

/forum/fa/3867/0/
Re: how to use commit statement inside a trigger [message #298714 is a reply to message #298666] Thu, 07 February 2008 05:01 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Technically, the question is whether the commit is still 'in the trigger', as you start a new autonomous transaction.

btw, your password is showing in the screenshots (title-bar)
Re: how to use commit statement inside a trigger [message #298717 is a reply to message #298714] Thu, 07 February 2008 05:37 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
1) True.
2) I'll paint it red next time /forum/fa/3518/0/
Re: how to use commit statement inside a trigger [message #298721 is a reply to message #298717] Thu, 07 February 2008 05:54 Go to previous message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Nice tool to grab a portion of the screen.

By
Vamsi
Previous Topic: Need information to write Oracle 10g OCP exam
Next Topic: Vertual instance
Goto Forum:
  


Current Time: Sat Dec 28 13:46:57 CST 2024