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 are the contents of dclgen?

0 Answers  


What is a Foreign Key?

0 Answers   Tavant Technologies, Zensar,


What is the purpose of the QUIESE Utility?

1 Answers  


How to test SQL -911 error while developing COB-DB2 program

1 Answers   Satyam,


What is difference between rollback and commit?

0 Answers  






What are the contents of a dclmgen?

0 Answers  


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?

0 Answers  


is there any restrictions for unions ?

4 Answers   Patni,


What are some SQL aggregates and other built-in functions?

2 Answers  


how to execute qcmdexc in rpgle?plz write code also?

1 Answers   IBM,


Explain various types of locks in db2?

0 Answers  


What is package versioning? Please give an example.

1 Answers  


Categories