What error I will get if my select query gives multiple
row while executing a Cobol-DB2 program.How can I solve it
without using a cursor.

Answer Posted / nitin sharma

Hi,

You will get -811 SQLCODE if more than one rows will be
returned by your query.

To avoid this you can also use FETCH FIRST 1 ROWS ONLY in
your query like

SELECT * FROM EMP
FETCH FIRST 1 ROWS ONLY;

Hope this helps.

Nitin

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is db2 instance?

587


What is the function of logging in the db2 database?

636


What is db2? Explain.

599


What is database reorganization?

584


What are the uses of db2 optimizer?

813






What is the role of schema in the db2 database?

642


How do I start db2 in windows?

554


What is db2 plan table?

611


what is utility for parm lib

1867


What are union and union all?

532


What is commit in db2?

588


What is sqlca?

608


What are foreign keys in db2?

608


Explain about mirror activator disk mirroring?

554


Discuss about db2 bind?

662