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.
Answers were Sorted based on User's Feedback
Answer / 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 |
u will get -811 error code.
this will b solve in different way. first u have to find
out y this error comes.
exmple :-
If u r selecting the address of the emp with help of
Name key, then may b same name contain 2 different address,
as per the business need, it may contain 1 defualt address
and other is alternet address.
So as per the business need find out that which address
u want to select, and as per this need u can use one flag
veriable to differentiate these 2 address. make the change
as per above in ur table. with the help of solution u can
solve the above problem without using the cursor.
| Is This Answer Correct ? | 0 Yes | 4 No |
What are the three types of page locks that can be held?
Explain what are the various isolation levels possible?
What is reorg and runstats in db2?
What techniques will be used to avoid deadlock??
What does DML stand for and what are some examples of it?
database DSNDB01 means a.db2 catalog b.db2 directory c.BSDS d.active logs answer with reason please
What is performance tuning db2?
Is DECLARE TABLE in DCLGEN necessary? Why it used?
What is ibm db2 database?
How do you leave the cursor open after issuing a COMMIT? (for DB2 2.3 or above only)
Mention the way of highlighting as well as putting a cursor to use in a cobol program.
What os does db2 run on?