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 cursor with hold option in db2?

614


Is db2 relational database?

574


What is multi row fetch in db2?

612


What is deadlock in db2?

587


How can record locking be achieved in those DB2 versions which do not support it?

627






in my project..TEST is db2 8.1 version In PROD it is 7.1 if i do REORG in TEST.. can I use the same REORG jcl with out modification in PROD region (this is DB2 8.1 )? if not, what modification i need to do in my REORG control card?

1628


What is access path in db2?

566


What are types of indexes?

595


Mention the downsides of page level lock.

711


What is cursor in dbms?

595


What is universal database?

621


What are the two types of logging in the db2 database? Explain them.

582


What type of database is db2?

527


What is bind and rebind in db2?

652


Which are the db2 tools to protect integrity of the database?

692