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

What Error I get, when Cursor not closed


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

New User


Joined: 06 Jan 2006
Posts: 21

PostPosted: Tue Jun 13, 2006 10:02 am
Reply with quote

Hi.

I have a cobol-db2 program, that contains a cursor.
I didnt closed that cursor (i have open & fetch stmt in the pgm).
Let me know whether it will give any error.

Thanks
Kalaignar
Back to top
View user's profile Send private message
anamikak

New User


Joined: 10 May 2006
Posts: 64
Location: Singapore

PostPosted: Tue Jun 13, 2006 2:21 pm
Reply with quote

SQLCODE -501 Cursor not open on FETCH
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Tue Jun 13, 2006 2:28 pm
Reply with quote

hi..

It depends on your Program Logic.
If there is single fetch in your Pgm..there shouldn't be any poblem.
else may abend.

~Vamsi
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Jun 13, 2006 3:48 pm
Reply with quote

Hey,

I dont think u will get any error..since u r opening the cursor & fetching the record...Cursor automatically closed after execution of ur program complete.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jun 13, 2006 7:49 pm
Reply with quote

Hello,
I agree with Ekta: when terminating, program closes cursor without error.
It does not matter how many FETCHes you did.
Back to top
View user's profile Send private message
anamikak

New User


Joined: 10 May 2006
Posts: 64
Location: Singapore

PostPosted: Wed Jun 14, 2006 9:42 am
Reply with quote

Yes, A cursor always closes when a UOW ends. But I would say that it is good practice to close cursor in your Db2 programs when result set is not needed. This would increase the performance.
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 Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top