View previous topic :: View next topic
|
Author |
Message |
pinakimishra
New User
Joined: 21 Jul 2007 Posts: 19 Location: phoenix
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Dsingh29
Active User
Joined: 16 Dec 2008 Posts: 132 Location: IBM
|
|
|
|
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 |
|
|
|