Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Declare of cursor statement using WITH HOLD OPTION

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
elango

New User


Joined: 27 Apr 2005
Posts: 12
Location: chennai

PostPosted: Thu Apr 28, 2005 2:43 pm    Post subject: Declare of cursor statement using WITH HOLD OPTION
Reply with quote

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
View user's profile Send private message

i413678
Currently Banned

Active User


Joined: 19 Feb 2005
Posts: 112
Location: chennai

PostPosted: Thu Apr 28, 2005 3:21 pm    Post subject: Re: Declare of cursor statement using WITH HOLD OPTION
Reply with quote

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
View user's profile Send private message
elango

New User


Joined: 27 Apr 2005
Posts: 12
Location: chennai

PostPosted: Thu Apr 28, 2005 3:57 pm    Post subject: Re: Declare of cursor statement using WITH HOLD OPTION
Reply with quote

hai


thanks for ur reply



regards

elango
Back to top
View user's profile Send private message
vaduri

New User


Joined: 19 Apr 2005
Posts: 2
Location: Hyderabad

PostPosted: Thu Apr 28, 2005 6:14 pm    Post subject:
Reply with quote

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
View user's profile Send private message
shymalasridevi

New User


Joined: 03 May 2005
Posts: 16

PostPosted: Tue May 03, 2005 3:06 pm    Post subject: hai,
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts Release of Adabas Cursor mohitsethi All Other Mainframe Topics 1 Mon Feb 06, 2017 8:36 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us