IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Cursor with hold for


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pinakimishra

New User


Joined: 21 Jul 2007
Posts: 19
Location: phoenix

PostPosted: Sat Dec 11, 2010 8:00 pm
Reply with quote

Hi,

I want to know where to use the Cursor with hold while declaring a cursor. I know that if we do not use a cursor with hold for then while we issue a commit statement then the cursor is closed and reopened which is a overhead. To avoid this cursor with hold for is used. But does this mean that then every cursor declared should have a cursor with hold for option or is there any specific scenario where I should use it. I have gone through the manuals and forum but can't decide where to use it and where not to use it. Can you provide some example or scenario where I should be using it.

Thanks
Pinaki
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Dec 12, 2010 2:30 am
Reply with quote

Hello and welcome to the forum,

It sounds as though you have a solution in search of a requirement. . .

Suggest you invest your time on this when the requirement has presented itself.

Also, if COMMITs are issued only at the end of some logical unit of work, they will not be issued very often and thus will not cause much overhead. . . Due to faster CPUs and dasd, many organizations no longer use COMMITs within a process. . .
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Mon Dec 13, 2010 3:57 pm
Reply with quote

One of the scenerio may be like....you have cursor within a cursor...and you want to commit inner cursor for every row fetch of outer cursor..in that case... you may need to declare the outer cursor with hold option so that it doesnot closes when commit is issued for inner cursor.


suggestions welcom, correct me if I am wrong.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
No new posts Restart logic by using cursor name in... DB2 1
No new posts Seeking Resolution for SQKCODE -991 o... DB2 2
No new posts Multiple rows within Cursor when Coun... DB2 14
No new posts Dynamic cursor name in Cobol program COBOL Programming 1
Search our Forums:

Back to Top