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
What is bufferpool in db2?
How do I delete a column in db2?
What are the uses of db2 optimizer?
What action db2 takes when a program aborts in the middle of a transaction?
Cursors can be declared in both working-storage & procedure division, agreed. But is there any difference? If could you please suggest what is the difference
How to find the number of rows in db2 tables?
Mention the various locks that are available in db2.
Why do we bind in db2?
What do you mean by cursor?
Why select is not preferred in embedded sql programs?
Is it possible using max on a char column?
Are views updateable?
Which command is used to remove all rows from a table?
What is a db2 schema?
What is the physical storage length of the data types: date, time, timestamp in the db2 database?