Cursors in DB2 follows the ANSI SQL standard of closing open cursors whenever a COMMIT or ROLLBACK statement is issued. But cursors that are declared with the WITH HOLD option remain open after a COMMIT statement is issued. Here all open cursors are closed when a ROLLBACK statement is issued.
If we are processing something in a cursor and inside the cursor for every record we have to commit or rollback and then go to the next record.
What will happen if i have to rollback on the 50th row and cursor has 500 rows to process?Here it closes the cursor itself since a rollback happened.
What should i do to retain the cursor OPEN and the cursor position same as before the ROLLBACK happened. Some body help me on this..