I 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_lo cal();
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')
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_lo cal();
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')
Comment