If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to Handle transaction commit or rollback in DB2 Stored Procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-18-05, 10:50
kelly_kong03 kelly_kong03 is offline
Registered User
 
Join Date: Jan 2005
Posts: 9
Smile How to Handle transaction commit or rollback in DB2 Stored Procedure

Hi...

Is there anybody who knows how to handle transaction commit and rollback in Stored procdure? is there any sample for that?
Reply With Quote
  #2 (permalink)  
Old 02-18-05, 12:39
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
You can use COMMIT, ROLLBACK TO SAVEPOINT and ROLLBACK ... These statements are NOT permitted within ATOMIC blocks ...

On mainframes, you have a COMMIT ON RETURN statement
On LUW, you can use an UNDO handler(provided the compound stmt is declared as ATOMIC) to rollback changes that were done within the compound statement


HTH

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 02-22-05, 10:30
kelly_kong03 kelly_kong03 is offline
Registered User
 
Join Date: Jan 2005
Posts: 9
thanks for replying, do u have a sample for that

do u have a sample for that? or material that i can read.

Thanks again
Reply With Quote
  #4 (permalink)  
Old 02-23-05, 14:48
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
An example
Large deletes...
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.

Last edited by sathyaram_s; 02-23-05 at 14:55.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On