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 |
Define db2 and its databases?
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.
4 Answers Cap Gemini, Verizon,
Mention the various locks that are available in db2.
How can you quickly find out the number of rows updated after an update statement?
What is QUIESCE?
What is db2 look?
What is db2 command?
what is REORG? what is the use?
If we keep the DCLGEN structure for a table in a copybook and include it in the COBOL program using the COPY statement, will there be any impact during compilation or at any stage of program execution?
What is a view? Why use it?
Normalization in DB2 – first normal form, second normal form
how do you resolve -818 error in db2. where we have to see time stamp token. i said by seeing in load module and plan .is it correct or not. give clear explination for how to see time stamp token