Posted: Sun Mar 23, 2014 5:50 am Post subject: SQLcode -206 and -501
I need help with this code. I am new to COBOL programming and SQL. I am want to use cursor to get information from two tables from the database. But I keep gettingt the sqlcode -206 and -501. I cannot see what the problem is in my code.
Can someone please explain to me why I cannot open and fetch?
01 CHOICE PIC 9 VALUE ZERO.
01 NUM pic x(4).
DECLARE CUR-EMP CURSOR FOR
Which SQL code was returned on the OPEN? You need to fix the OPEN before you continue.
-206 returned on OPEN. I do not know how to fix it. I have compared the code with another code that works and they look the same.
And, please use the code tags when posting code, data, JCL, scrren cut'n'pastes and the quote tags when quoting someone. To find out more about these use the 'Preview' button instead of the 'Submit' button and you will get to the advanced editor where there are buttons for these functions. _________________ Regards
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum