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 is the maximum number of tables that can be joined ?
What is lock contention?
Define sqlca.
Can we delete records from view?
Where can you declare a cursor in a cobol-db2 program?
File not opened because library is *PROD and debug is UPDPROD(*NO). ? what may be the reason? how to solve it..?
What are union and union all?
How do you run JCL in cobol program
What is the cascade rule and how does it relate to deletions made with a subselect?
What is the COBOL picture clause for a DB2 column defined as DECIMAL(11,2)?
Can there be more than one cursor open for any program?
Is db2 a database?