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

how to get duplicate records from tables?write qurey for this?

4 Answers   ANZ,


How do I delete a table in database?

0 Answers  


How is the SUBSTR keyword used in sql?

1 Answers  


How can the duplicate values be eliminated from db2 select?

0 Answers  


what is Runstats? Whem will u choose to runatats?

1 Answers   Danske,


Select empno, sal from emptbl where empno < 101.By this query can we fetch first 100 recs? where empno is primary key.It won't throw -811 error? if it wont,then what is use of cursor technique while fetching first 100 recs. Please need more clarification.

2 Answers  


select * from orders where odate between '2010-01-01'and '2010-03-31' How do u fetch this into cursor?

2 Answers  


What is the use of predicate?

0 Answers  


I use CS and update a page. Will the lock be released after I am done with that page?

2 Answers  


How could one combine a set of incremental image copies into a single copy?

1 Answers  


I have 1000 rows in a db2 table.I want to update first 100 records,How do I do it?

4 Answers   CTS,


What DB2 Catalog column tell you when an index needs table reorganized ?

1 Answers  


Categories