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
 

 

Cursor with hold for

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

New User


Joined: 21 Jul 2007
Posts: 1
Location: phoenix

PostPosted: Sat Dec 11, 2010 8:00 pm    Post subject: Cursor with hold for
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

Site Director


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

PostPosted: Sun Dec 12, 2010 2:30 am    Post subject:
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    Post subject: Reply to: Cursor with hold for
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    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 Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts How LOAD PROGRAM and LOAD on HOLD is ... pkmurali CICS 4 Tue May 03, 2016 6:26 pm
No new posts How to hold a daily job for a monthly... anandgbe CA Products 8 Mon Mar 07, 2016 12:59 pm
No new posts DB2 Stored Procedure - Dynamic SQL - ... GuyC DB2 2 Wed Feb 17, 2016 5:10 pm


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