This was related to -811 sqlcode, In a COBOL DB2 program
which accesses employee table and selects rows for employee
'A', it should perform a paragraph s001-x if employee 'A'
is present. In this case it gets -811 sqlcode, but still it
process the paragraph s001-x. What could be wrong in my
code.

Answers were Sorted based on User's Feedback



This was related to -811 sqlcode, In a COBOL DB2 program which accesses employee table and selects..

Answer / srivalli janapati

Your code must not be using the CURSOR concept and NOT
handling the abend properly.When atleast CURSOR is not
being used in the code,there should be alteranative code to
handle when query resulted in retrieving multiple rows.

-811: is basically the SELECT query resulted in retrieving
more than a Row

Meaning,the resultant query must be retrieving more than a
row,and tried to push all the resualtant rows at a time for
the processing.COBOL-DB2 program can't handle this
situation as it expects a row at a time and then ABENDS.

Is This Answer Correct ?    16 Yes 0 No

This was related to -811 sqlcode, In a COBOL DB2 program which accesses employee table and selects..

Answer / karamveer

-811 will come because you have the multiple record fetched by your query. But still your para is stored because first record from your query resultset is fetched and processed. -811 is error but it will not abend your program and it runs fine. You need to build query which result unique record.

Is This Answer Correct ?    0 Yes 0 No

This was related to -811 sqlcode, In a COBOL DB2 program which accesses employee table and selects..

Answer / sangeethas1985

anybody who has an idea about this, please post answer.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More DB2 Interview Questions

What is the command used by TSO users to invoke DB2?

2 Answers   IBM,


I need to view the number of tables existing under one particular Owner. Is it possible? If so, pl give the SQL query for this?

3 Answers  


how to resolve -811

2 Answers   IBM,


In BIND, isolation level parameter specifies the duration of page lock and ACQUIRE, RELEASE also do almost the same thing. What is the exact difference between the two? Do they work in conjunction while executing SQL queries and obtaining locks?

8 Answers   Syntel,


What is the syntax required for the creation of a cursor?

1 Answers  


What is the difference between primary key & unique index ?

6 Answers   Patni, Temenos,


How to view db2 table structure?

0 Answers  


Suppose we have a query for update update table1 set col1 = 'val1' where col2=(select .... from ...) suppose the subquery does not return any record, what will happen to update?

1 Answers   IBM,


What are the uses of db2 optimizer?

0 Answers  


How to select the duplicate rows from a table?

4 Answers  


What is an inner join, and an outer join ?

1 Answers   CTA,


what is the maximum number of tables that can be joined ?

8 Answers   IBM, TCS,


Categories