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 contents of dclgen?
What is a Foreign Key?
0 Answers Tavant Technologies, Zensar,
What is the purpose of the QUIESE Utility?
How to test SQL -911 error while developing COB-DB2 program
What is difference between rollback and commit?
What are the contents of a dclmgen?
I need to view the number of tables existing under one particular Owner. Is it possible? If so, pl give the SQL query for this?
is there any restrictions for unions ?
What are some SQL aggregates and other built-in functions?
how to execute qcmdexc in rpgle?plz write code also?
Explain various types of locks in db2?
What is package versioning? Please give an example.