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 cursor stability?
Explain the contention situations caused by locks?
DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join. Explain the differences?
What are the three DB2 date and time data types and their associated functions?
what is diffrence b/w file-aid tool and file-aid utility???
select 100 records from million records ?
Where would you find information about the type of database authority held by the user?
what is static sql? what is dynamic sql? Give me details
Is Cursor exicutable ?
List down the types of triggers in the db2 database?
How would you move a tablespace (using STOGROUP) to a different DASD volume allocated to that tablespace?
Usually, which is more important for DB2 system performance - CPU processing or I/O access?