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

Closing an unopened cursor


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Mar 26, 2008 1:14 pm
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
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
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
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: 6966
Location: porcelain throne

PostPosted: Wed Mar 26, 2008 5:09 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Mar 26, 2008 5:14 pm
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: 6966
Location: porcelain throne

PostPosted: Wed Mar 26, 2008 6:24 pm
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: 771
Location: Germany

PostPosted: Wed Mar 26, 2008 6:35 pm
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: 6966
Location: porcelain throne

PostPosted: Wed Mar 26, 2008 7:38 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Mar 26, 2008 7:44 pm
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: 6966
Location: porcelain throne

PostPosted: Wed Mar 26, 2008 8:02 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
No new posts Restart logic by using cursor name in... DB2 1
No new posts Seeking Resolution for SQKCODE -991 o... DB2 2
No new posts Multiple rows within Cursor when Coun... DB2 14
No new posts Dynamic cursor name in Cobol program COBOL Programming 1
Search our Forums:

Back to Top