View previous topic :: View next topic
|
Author |
Message |
ElHachu
New User
Joined: 12 Mar 2010 Posts: 9 Location: Madrid
|
|
|
|
Hi all. I've been searching in the forum about sqlcode -501, but didn't find the answer to my problem.
I have a cursor and when I fetch it, it returns a sqlcode -501. My main problem is that the previous instruction is the OPEN and it returns a sqlcode 0.
So guys, if I have my cursor correctly opened, any idea about why I'm receiving the -501 in the fetch?
Thank you so much. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
ElHachu
New User
Joined: 12 Mar 2010 Posts: 9 Location: Madrid
|
|
|
|
I have done it. I don't like others to waste my time, so I don't like to waste others'. If I ask is because I have finished all my resources (books, manuals, team mates, searching this and other forums...).
In this program there is only one cursor. Seeing your answer I checked it (with automatic code generator you never know).
We think the OPEN isn't working properly, but we can't explain it if we receive a sqlcode 0. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
If You had You should have understood that the manual is DEFINITIVE about the reason
so the way You posed Your question is just a waste , confirm, WASTE of time for everybody !
and You should not have expected any other reply
Quote: |
We think the OPEN isn't working properly |
how many millions of open cursor are taking place right now ....
and how unlucky that Yours is not working properly
You should be asking on a witchcraft forum, not an IT one .... |
|
Back to top |
|
|
ElHachu
New User
Joined: 12 Mar 2010 Posts: 9 Location: Madrid
|
|
|
|
enrico-sorichetti wrote: |
If You had You should have understood that the manual is DEFINITIVE about the reason
|
I know. That's why I ask, I think I made a mistake I didn't notice.
I can't understand why you get angry, I checked the manuals, the code... everything before posting. And I do tests. Don't think I am like some people here who prefer asking in the forum instead of googling a bit before. You didn't need to be so rude.
Well, no problem, don't waste your time anymore..
Bye forever |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
I am not getting angry... ( I just like to play around with words )
it is just that with the info You provided, I gave You the only reasonable reply..
if You believe that You have done the due diligence, then the only thing left is to open a ticket with IBM |
|
Back to top |
|
|
ElHachu
New User
Joined: 12 Mar 2010 Posts: 9 Location: Madrid
|
|
|
|
Sorry Enrico. That is the problem when you "talk" to someone and don't see the face. Let's start again, ok?
I pasted the sql sentences in a plain new program and work...
I think there is a problem with that fu... automaticly generated code. I hate it.
We are making tests in order to get where is the error. I won't sleep till I get it!!! God is my witness!
When found, I'll post here and sure we'll laugh |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
let' s sing with the Pink Floyds
we don' t need no automation ... |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
ElHachu wrote: |
[...]I think there is a problem with [...] automaticly generated code. [...] |
Can you post the stuff here, including some in front and after the SQL that now works? |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
Are you sure there aren't any fetches (with sqlcodes) that cause the cursor to get closed.
Or that you have passed the CLOSE statement in the code? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
either you are fetching a different cursor than was opened
or the one you opened was closed before the fetch.
not anymore complicated than that.
take a look at the dbrm that was generated. |
|
Back to top |
|
|
mambopras
New User
Joined: 11 Nov 2008 Posts: 52 Location: Hyderabad
|
|
|
|
I hope no COMMITs were issued before trying to fetch - (Just in case) |
|
Back to top |
|
|
|