When u will use cursor with hold option?

Showing Answers 1 - 4 of 4 Answers

Ravi

  • Aug 6th, 2005
 

On executing a COMMIT statement in the Program all the open cursors are closed. 
 
In order to avoid this we use the WITH HOLD option.

manoj pingale

  • Dec 8th, 2005
 

If u r using a cursor in program and there is a commit statement it will close the cursor, so in order to avoid that u use a cursor with hold option to retain the cursor position

subbu

  • Feb 20th, 2006
 

 hi,

We use cursor only when we updating existing records or Inserting Some Records to the Table.

When you Using commit, in DB2 every single row will be commited after the process. If abend occurs only the cursor will be closed, we can start from last position(Where it abended) of cursor , using Restart

from

subbu

  Was this answer useful?  Yes

B L Praveen

  • Sep 21st, 2007
 

You will declare the Cursor with "WITH HOLD " Option when you want the cursor to be pointing to the next row even after the fetch from the db2 table and you exit from the program until expilicit commit is performed to updated to Db2 and Close cursor command is executed.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions