Can you use a select query in a loop to fetch multiple rows?
If so what is the advantage of using a cursor?

Answers were Sorted based on User's Feedback



Can you use a select query in a loop to fetch multiple rows? If so what is the advantage of using a..

Answer / azharuddinsyed

No. In cobol-db2 program, the result of single select should be only one row.
For multi row fetch we must use cursor, else program will abend with -811 sql code.

Is This Answer Correct ?    1 Yes 0 No

Can you use a select query in a loop to fetch multiple rows? If so what is the advantage of using a..

Answer / satheesh reddi

no...for that we are using cursors. due to cursors we can retrieve or fetch number of rows at a time from the table

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB2 Interview Questions

What is rebind in db2?

0 Answers  


Comment whether dclgen is mandatorily used. If not, then what is the point of using it?

0 Answers  


What is the difference between plan and package in db2?

0 Answers  


One program calling 5 subprograms, its a cobol db2 program, after precompilation how many plans and packages will created?

3 Answers  


What is alias in db2?

0 Answers  






How to define the data items to receive the fetch items for the SQL?

2 Answers  


How to design maps

1 Answers   Virtusa,


What is db2 look?

0 Answers  


What are the various data types available in db2?

0 Answers  


what is SMP/E? and what are the major steps of it? thanks...

1 Answers   IBM,


How can you find out which query is taking lot of time to execute in cobol-db2 program ?

1 Answers   Danske,


Request to database but database is not available so what is was abend is raised?

2 Answers   UST,


Categories