Page 1 of 1

A question about SQLCODE -811 in DB2.

Posted: Fri Dec 04, 2015 11:49 am
by BappiL
Hi,

Assuming I am working on a COBOL DB2 program. A batch program. I execute a SQL query in the program which causes a SQLCODE -811. Now which row will be fetched in DCLGEN or host variable as the select statement had fetched more than one row and with -811 SQL code? Obviously there are duplicates but which duplicate is there?

Will the "fetch first row only" fetches the same row, as the row fetched when we handle -811 SQLCODE? :?:

Re: A question about SQLCODE -811 in DB2.

Posted: Fri Dec 04, 2015 4:27 pm
by nicc
Do you know if it fetches any data at all? If you don't then I suggest the following:
a) read the manual
b) DISPLAY the variable that is supposed to be populated by the query whilst doing your error handling.