View previous topic :: View next topic
|
Author |
Message |
simimathew
New User
Joined: 26 Jan 2006 Posts: 23 Location: London
|
|
|
|
Hi,
Can somebody tell me what happens when a DB2 cursor has been opened, fetching and processing is done and the cursor is not closed programatically? Will all the cursors used in the program be automatically closed at the end of run (batch programs)? |
|
Back to top |
|
|
hariavinash
New User
Joined: 04 Jan 2006 Posts: 64
|
|
|
|
Unless you do a COMMIT, cursor will still be active. but a cursor declared with HOLD option will not close the cursor even on commit.
cheers |
|
Back to top |
|
|
vijayamadhuri
Active User
Joined: 06 Apr 2005 Posts: 180
|
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
simimathew,
Yes, an open cursor is closed by the operating system at termination of your job, just as it closed any PS/VSAM files. It is, however, good practice to close all open files cursors within you program prior to ending.
Dave |
|
Back to top |
|
|
die7nadal
Active User
Joined: 23 Mar 2005 Posts: 156
|
|
|
|
David,
But what happens in an Abend situation, does it still close. I have had some problem with VSAM files, if they are not properly closed. Any idea. |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
die7nadal,
Yes for abends that cursor is also closed.
The only problem, and really not a problem, with VSAM files on abends is that it gives a open status of 97 instead of 00. This is OK and just a warning that the last time the VSAM file was used it did not close normally. Have you experienced other problems?
Dave |
|
Back to top |
|
|
simimathew
New User
Joined: 26 Jan 2006 Posts: 23 Location: London
|
|
|
|
Thanks a lot for all the information.
Cheers,
Simi |
|
Back to top |
|
|
anilpalcs
New User
Joined: 10 May 2006 Posts: 1
|
|
|
|
HI,
i m facing some problem during cursor opening. during cursor opening
it show the sqlcode 00099j
plz help me as soon as possible |
|
Back to top |
|
|
|