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

In cursor program perform para varying until 1 by 1 fetch para cursor------close para in the blank what will come for confirming in the database?

1 Answers   HCL,


Explain packages.

0 Answers  


Can a primary key have null values? If we try to insert a null value in a primary key column, will it work or give an error code?

6 Answers  


What are common abends

1 Answers   SPIC, Virtusa,


What are types of indexes?

0 Answers  


Mention the downsides of page level lock.

0 Answers  


How can we define a table? How can we apply SEARCH ALL on it ?

1 Answers  


what is REORG? what is the use?

4 Answers  


How to check table size in db2 sap?

0 Answers  


Hello All, We have requirment to Replace BMC Db2 Load product thru CA FAST LOADPlus product. Do anyone have JCL to for FAST LOADPLUS and what all are thing need to take in consideration.

0 Answers   IBM,


How do you eliminate duplicate values in db2?

0 Answers  


What does DSNDB07 database do?

2 Answers  


Categories