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

Where can you declare a cursor in a cobol-db2 program?

603


Which isolation level provides highest data integrity?

599


Explain about cursor stability?

621


My sql statement select avg(salary) from emp yields inaccurate results. Why?

641


How to rename a table in DB2 ?

638






List down the types of triggers in the db2 database?

590


What is reorg and runstats in db2?

694


For a db2 column that is being defined as decimal (11, 2), discuss the cobol picture clause.

659


is it compulsory commitment control in journal?

2010


What is package in db2 mainframe?

558


What is the difference between drop table and delete table?

552


When a COBOL-DB2 program in PRODUCTION is updating main tables and gone for long run, what have to do?

3120


What is the purpose of using commit?

617


Mention the location where the output received from explain statement is stored.

628


When the like statement is used?

640