A question about SQLCODE -811 in DB2.

RDBMS from IBM and IBM's Hierarchical DBMS and Transaction Manager (IMS DC).
Post Reply
BappiL
New Member
Posts: 5
Joined: Sat Sep 19, 2015 8:54 pm

A question about SQLCODE -811 in DB2.

Post 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? :?:
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: A question about SQLCODE -811 in DB2.

Post 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.
Regards
Nic
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM DB2 and IMS DB/DC”