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 db2 catalog database?
What is commit in db2?
What happens to a tablespace when its recovery infromation has been removed and a full recovery is no longer possible?
Is DECLARE TABLE in DCLGEN necessary? Why it used?
Compare a subselect to a join?
How to know the primary key of a table without defining the primary key in the table?
What do you mean by between and in? Is between inclusive of specified range values?
What is check constraint. Explain with example.
What is index cardinality?
how can you copy records present in a flat physical file to a database file(physical file).please explain in rpg400 with a simple example
What is a db2 table?
How to view db2 table structure?