Home » SQL & PL/SQL » SQL & PL/SQL » Trigger
Trigger [message #240874] Sun, 27 May 2007 01:12 Go to next message
biplab
Messages: 1
Registered: May 2007
Location: Mumbai
Junior Member
Why Transaction Control Statement ( Commit and Rollback) are not used in Trigger. Clarify with example.
Pls send its reply to bip321_kumar@yahoo.co.in

[Updated on: Sun, 27 May 2007 01:13]

Report message to a moderator

Re: Trigger [message #240875 is a reply to message #240874] Sun, 27 May 2007 01:27 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
What is your opinion?
Why commit or rollback should not be done in trigger?
In which case(s) it would useful?

Regards
Michel

[Updated on: Sun, 27 May 2007 01:27]

Report message to a moderator

Re: Trigger [message #240879 is a reply to message #240874] Sun, 27 May 2007 03:05 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
biplab wrote on Sun, 27 May 2007 08:12
Pls send its reply to bip321_kumar@yahoo.co.in


Ask in forum, get answers in forum.
Re: Trigger [message #240883 is a reply to message #240879] Sun, 27 May 2007 03:38 Go to previous message
Frank Naude
Messages: 4581
Registered: April 1998
Senior Member
The reason is stated quite clearly in the FAQ you've quoted:

"Changes made within triggers should be committed or rolled back as part of the transaction in which they execute. Thus, triggers are NOT allowed to execute COMMIT or ROLLBACK..."

and

"Autonomous transactions execute separate from the current transaction. [...] Unlike regular triggers, autonomous triggers can contain COMMIT and ROLLBACK statements."

Previous Topic: Preventing commit in a "Before update" trigger.
Next Topic: Database Design
Goto Forum:
  


Current Time: Tue Dec 03 08:08:31 CST 2024