Help ... Rollback Transaction

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • varmamkm
    New Member
    • Jan 2008
    • 4

    Help ... Rollback Transaction

    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')
  • sakumar9
    Recognized Expert New Member
    • Jan 2008
    • 127

    #2
    Try these links:

    http://publib.boulder. ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw .apdv.java.doc/doc/cjvjdsvp.html

    http://publib.boulder. ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw .sql.ref.doc/doc/r0003271.html

    Comment

    Working...