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 host variable in db2 cobol?

805


What is package in cobol db2?

871


What is the difference between dbm cfg and db cfg file in db2 ?

1264


Is the primary key a clustered index?

838


i want to maintain uniqueness on pdf without make lf??????????

1904


What is the physical storage length of time data type?

886


Is db2 a mainframe database?

736


Can you tell me how can you find out the # of rows updated after an update statement?

864


What is bind package and plan in db2?

803


What are types of indexes?

777


Is db2 a mainframe?

790


What is dbrm?

858


What is dbrm? What it contains? When it will be created?

798


What is netezza database?

773


Explain about rct.

858