View previous topic :: View next topic
|
Author |
Message |
elango
New User
Joined: 27 Apr 2005 Posts: 12 Location: chennai
|
|
|
|
hai friends,
What is the use of WITH HOLD OPTION, while declaring a cursor statement. can any one help me to know that.
regards
elango. |
|
Back to top |
|
|
i413678 Currently Banned Active User
Joined: 19 Feb 2005 Posts: 112 Location: chennai
|
|
|
|
Hi,
if you dont want to close the cursor till end of the transaction then you have to use this option.
Cheers........
pavankumar |
|
Back to top |
|
|
elango
New User
Joined: 27 Apr 2005 Posts: 12 Location: chennai
|
|
|
|
hai
thanks for ur reply
regards
elango |
|
Back to top |
|
|
vaduri
New User
Joined: 19 Apr 2005 Posts: 2 Location: Hyderabad
|
|
|
|
Whenever the Commit statement executes in your COBOL-DB2 program, all the cursors which were opened will be closed. You need to explicitly open the cursor again. (other wise -501 SQL error)..
Inorder to keep the cursor open while execution of commit, we need to declare the cursor with "WITH HOLD FOR" option.
But, the cursor declared with "WITH HOLD FOR" option will be closed upon execution of "ROLL BACK" statement but normal cursors will not be closed while "ROLL BACK" statemet execution. |
|
Back to top |
|
|
shymalasridevi
New User
Joined: 03 May 2005 Posts: 16
|
|
|
|
hai,
in the real environment multiple users will use the same table that u r using
in that situation if they will do commit transaction then ur cursor will be automatically closed if u don't use the cursor WITH HOLD option
if u use WITH HOLD option ur cursor will remains unchanged sothat u can retreive the data .
i think it is sufficient for u
if u have any doubts plz let me know
bye |
|
Back to top |
|
|
|