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

Which component is used to execute the sql statements?

0 Answers  


How do you concatenate the firstname and lastname from emp table to give a complete name?

0 Answers  


What is the maximum number of columns in a db2 table?

0 Answers   IBM,


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.

4 Answers   Cap Gemini, Verizon,


How to rename a table in DB2 ?

0 Answers   MCN Solutions,






What are the benefits of using the db2 database?

0 Answers  


When is the access path determined for dynamic SQL?

2 Answers  


What DB2 Catalog column tell you when an index needs table reorganized ?

1 Answers  


How to connect to db2 database from windows command line?

0 Answers  


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

1 Answers  


What statistic will tell the DBA how must space can be reclaimed from dropped table spaces on the next reorg run?

1 Answers  


we can code COPY DCLGEN or INCLUDE DCLGEN, At which stage of the precompilation , dclgen get expanded if we write 1) copy 2) include one question about dclgen.. Is it mandatory to use declare table in dclgen.. I think no...but it will be used by the precompiler to validate the table name,column name etc.., can one clear my doubt ..is it necessary to include declare table or not?

2 Answers  


Categories