
January 13th, 2006, 06:21 AM
|
|
Registered User
|
|
Join Date: Jan 2006
Posts: 2
Time spent in forums: 17 m 10 sec
Reputation Power: 0
|
|
Cursor behaviour with the RoLLBACK statement
Hi all,
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 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..
Thanks,
Sn
|