Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1243
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts FUSE - IBM MQ - CICS integration error Kevin Vaz CICS 1 Mon Sep 18, 2017 4:31 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us