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 technique is used to retrieve data from more than one table in a single SQL statement?
In a DB2-CICS program which is acts as co-ordinator and which is participant?
Outputs of explain are with matchcols = 0. What does this signify?
Define db2.
File not opened because library is *PROD and debug is UPDPROD(*NO). ? what may be the reason? how to solve it..?
How do I start db2 in windows?
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?
What is buffer pool in the db2 database?
What statistic will tell the DBA how must space can be reclaimed from dropped table spaces on the next reorg run?
What parameters are used to control the free space in DB2?
i want to delete 20th million record how ?
What is a recovery log?