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 > Help ... Rollback Transaction

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-28-08, 03:12
varmamkm varmamkm is offline
Registered User
 
Join Date: Jan 2008
Posts: 8
Help ... Rollback Transaction

am new to db2 and want to know more about rollback and exception handling....
I am using AS/400 operations navigator to write the stored procedures.

I am trying this by using SAVEPOING and ROLLBACK but no luck... please help me out.....
Declare exit handler for sqlexception set nerror = sqlcode;
insert into empmaster (empname) values('test');
set emp_id = identity_val_local();
savepoint a on rollback retain cursors;
insert into empdetails (empid, empaddress) values(emp_id,'add');
savepoint b on rollback retain cursors;
if nerror != 0 then

rollback to savepoint a;
end if;

I am calling the stored procedures from Java like
ex: CALL save_data('dd','ddd')
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