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
 

 

What Error I get, when Cursor not closed

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: What Error I get, when Cursor not closed
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    Post subject:
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    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Tue Jun 13, 2006 3:48 pm    Post subject:
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: 1226
Location: Israel

PostPosted: Tue Jun 13, 2006 7:49 pm    Post subject:
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    Post subject:
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    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 IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am


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