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
 

 

SQLCODE -508 - Cursor not positioned on a Row

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: SQLCODE -508 - Cursor not positioned on a Row
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    Post subject: Re: SQLCODE -508
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    Post subject: Re: SQLCODE -508 - Cursor not positioned on a Row
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    Post subject: Re: SQLCODE -508 - Cursor not positioned on a Row
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    Post subject: Re: SQLCODE -508 - Cursor not positioned on a Row
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    Post subject: Re: SQLCODE -508 - Cursor not positioned on a Row
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    Post subject: Hello shasikanth
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts DB2 SQL Error: SQLCODE=-440, SQLSTATE... kishpra DB2 1 Sat Feb 18, 2017 2:31 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