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
 

 

Closing an unopened cursor

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

New User


Joined: 05 Jan 2007
Posts: 18
Location: chennai

PostPosted: Wed Mar 26, 2008 1:10 pm    Post subject: Closing an unopened cursor
Reply with quote

What will happen if i tried to close the cursor which is not opened.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Wed Mar 26, 2008 1:14 pm    Post subject: Reply to: Closing an unopened cursor
Reply with quote

Try and tell us icon_cool.gif
Back to top
View user's profile Send private message
Richa Jain

New User


Joined: 18 Mar 2008
Posts: 35
Location: Gurgaon

PostPosted: Wed Mar 26, 2008 3:22 pm    Post subject:
Reply with quote

To my knowledge when the CLOSE statement is executed, the cursor must be in the open state.

If we are closing an unopened cursor , we must get an sql error, SQLCODE = -501.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Wed Mar 26, 2008 4:03 pm    Post subject:
Reply with quote

the answer is easy:
Code:
DSNT408I SQLCODE = -501, ERROR:  THE CURSOR IDENTIFIED IN A FETCH OR CLOSE STATEMENT IS NOT OPEN                                                     


BUT....We were waiting for the OP to post the answer after trying it....
Back to top
View user's profile Send private message
abiyn

New User


Joined: 25 Mar 2008
Posts: 12
Location: Chennai

PostPosted: Wed Mar 26, 2008 4:07 pm    Post subject:
Reply with quote

The program will go in infinite loop with the SQLCODE error -501.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Mar 26, 2008 5:09 pm    Post subject:
Reply with quote

Quote:

The program will go in infinite loop with the SQLCODE error -501


please, if you are trying to up your post count, at least avoid making non-sense comments.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Wed Mar 26, 2008 5:14 pm    Post subject: Reply to: Closing an unopened cursor
Reply with quote

/friendly humor on

unless the poster belongs to the ...
I always want to see a 0 return code club

/pseudocode on
do until rc .eq. 0
close cursor
end
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Mar 26, 2008 6:24 pm    Post subject:
Reply with quote

Quote:

Dick Brenholtz ,

I don’t understand What is wrong in my comments. I just replied for that question.
Why should I try to post unnecessarily?

I know this is Technical forum.
Behave in a matured and professional manner


I thought that I was rather civil.

how's this?:
to say that a program, that you have never seen, will go into an infinite loop because of a -501 sqlcode, is dummmmmmmmmmmmb.

Don't come whinning via private messages, I will publicize them.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 755
Location: Germany

PostPosted: Wed Mar 26, 2008 6:35 pm    Post subject:
Reply with quote

So here are my two cent too !

Seams to be funny, that one can engage so many it-proffesionals with such a question. Before asking, just have a test and see.

@Dick
...your right !
...so now, also my post count is at least one more !!!

Regards, UmeySan
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Mar 26, 2008 7:38 pm    Post subject:
Reply with quote

yeah, right with the knowledge, left (without) people skills.

still smarting over the esds aix.

abiyn,

my apologizes. nothing you said required the response that I gave.

dbz
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Wed Mar 26, 2008 7:44 pm    Post subject: Reply to: Closing an unopened cursor
Reply with quote

Quote:
still smarting over the esds aix.


... are there any more tests that I should run icon_question.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Mar 26, 2008 8:02 pm    Post subject:
Reply with quote

no enrico,

esds do not have primary indexes, yet you can create an aix.

had my head in the sand, just could not believe it. learned alot from that thread (where I should actually be puting this post).

dbz
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