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
 

 

DB2 cursor

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

New User


Joined: 26 Jan 2006
Posts: 23
Location: London

PostPosted: Tue May 09, 2006 6:55 pm    Post subject: DB2 cursor
Reply with quote

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
View user's profile Send private message

hariavinash

New User


Joined: 04 Jan 2006
Posts: 64

PostPosted: Tue May 09, 2006 8:36 pm    Post subject:
Reply with quote

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
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Tue May 09, 2006 8:52 pm    Post subject: hi
Reply with quote

please follow this linkhttp://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/dsnapj12/2.2.3.2?SHELF=&DT=20050328013405&CASE=
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue May 09, 2006 11:41 pm    Post subject: Re: DB2 cursor
Reply with quote

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
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Wed May 10, 2006 12:05 am    Post subject:
Reply with quote

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
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Wed May 10, 2006 12:16 am    Post subject: Re: DB2 cursor
Reply with quote

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
View user's profile Send private message
simimathew

New User


Joined: 26 Jan 2006
Posts: 23
Location: London

PostPosted: Wed May 10, 2006 2:21 pm    Post subject: Re: DB2 cursor
Reply with quote

Thanks a lot for all the information.

Cheers,
Simi
Back to top
View user's profile Send private message
anilpalcs

New User


Joined: 10 May 2006
Posts: 1

PostPosted: Thu May 11, 2006 10:37 am    Post subject: DB2 cursor
Reply with quote

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
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 Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts Release of Adabas Cursor mohitsethi All Other Mainframe Topics 1 Mon Feb 06, 2017 8:36 pm
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


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