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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am


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