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



What error I will get if my select query gives multiple row while executing a Cobol-DB2 program.H..

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

What error I will get if my select query gives multiple row while executing a Cobol-DB2 program.H..

Answer / dedu

-811 ERROR CODE

Is This Answer Correct ?    6 Yes 0 No

What error I will get if my select query gives multiple row while executing a Cobol-DB2 program.H..

Answer / mangesh

Thanks Debu & Santy

Is This Answer Correct ?    5 Yes 1 No

What error I will get if my select query gives multiple row while executing a Cobol-DB2 program.H..

Answer / santy

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

Post New Answer

More DB2 Interview Questions

what is cursor stability?

2 Answers   IBM,


Explain the contention situations caused by locks?

0 Answers  


DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join. Explain the differences?

0 Answers  


What are the three DB2 date and time data types and their associated functions?

1 Answers  


what is diffrence b/w file-aid tool and file-aid utility???

1 Answers  


select 100 records from million records ?

2 Answers   Verizon,


Where would you find information about the type of database authority held by the user?

2 Answers  


what is static sql? what is dynamic sql? Give me details

3 Answers  


Is Cursor exicutable ?

3 Answers   TetraSoft,


List down the types of triggers in the db2 database?

0 Answers  


How would you move a tablespace (using STOGROUP) to a different DASD volume allocated to that tablespace?

1 Answers  


Usually, which is more important for DB2 system performance - CPU processing or I/O access?

1 Answers  


Categories