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

SQLCODE -508 - Cursor not positioned on a Row


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shasikanth

New User


Joined: 18 Aug 2003
Posts: 4

PostPosted: Sat Nov 11, 2006 1:35 am
Reply with quote

Hi,

I have a batch DB2 program(PGM1) which call a store procedure(SPROC).

the PGM1 has a cusrsor defined WITH HOLD and FOR UPDATE of function. For every fetch on this cusrsor i will be calling the stored proc the after the return from SPROC the PGM1 will be updating the row with WHERE CURRENT cursor. But at this point i am hitting SQLCODE -508 ("THE CURSOR IDENTIFIED IN THE UPDATE OR DELETE STATEMENT IS NOT POSITIONED ON A ROW")

Can some one tell me why it is throwing this message.

Thanks in advance...
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Sat Nov 11, 2006 4:32 am
Reply with quote

check if the return code from u r SPROC is good .Because if that fails then u r cursor will not position at the required point
Back to top
View user's profile Send private message
shasikanth

New User


Joined: 18 Aug 2003
Posts: 4

PostPosted: Sun Nov 12, 2006 11:15 pm
Reply with quote

The return code from proc is good.

I am doing the update(where current of) only when the return from the STOR PROC is gud...
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Mon Nov 13, 2006 9:17 pm
Reply with quote

is u r sql code from the proc =100 the cursor will not work

What is u r sql code?
Back to top
View user's profile Send private message
shasikanth

New User


Joined: 18 Aug 2003
Posts: 4

PostPosted: Wed Nov 15, 2006 2:31 am
Reply with quote

tHE SQLCODE IS ZERO. This is how the code is..

EXEC SQL
CALL DB2XXX.TTT_TT
(
)
END-EXEC.

EVALUATE TRUE
WHEN SQLCODE--SUCCESSFUL
CONTINUE and do where update of oncurrent curosr
ELSE
Abend

Hope atleast now you will help me answering to my problem without asking further obvious Questions.....
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Nov 15, 2006 3:12 am
Reply with quote

further obvious questions? my, my, a little touchy; normally a response from someone who has no idea of wants going wrong and does not want to hear anything that disagrees with current mindset.

you are checking an sqlcode with an 88 level. are you sure that the 88 level is referencing a field that has been populated by your proc and returned to your module?
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Wed Nov 15, 2006 10:43 pm
Reply with quote

probably is not working at all .Check if it is picking up tha desired row before u r even going into the sproc.

further obvious Questions.....

I am trying to help... with the information I HAVE...


Please keep u r frustration to u r self...
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Wed Nov 15, 2006 10:44 pm
Reply with quote

probably u r fetch is not working at all .Check if it is picking up tha desired row before u r even going into the sproc.

further obvious Questions.....

I am trying to help... with the information I HAVE...


Please keep u r frustration to u r self...
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Positioned Deletes/Updates using curs... DB2 3
No new posts SQLCODE = -122 while using the scalar... DB2 4
No new posts SQLCODE = -16002 when using XMLEXISTS DB2 1
No new posts Is SQLCODE -811 possible while fetchi... DB2 1
No new posts Restart logic by using cursor name in... DB2 1
Search our Forums:

Back to Top