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

How does the processing of a correlated subquery differ from a non correlated subquery?

1 Answers  


What is declare cursor?

0 Answers  


how can i pull up a query which was previously stored in qmf

3 Answers  


My sql statement select avg(salary) from emp yields inaccurate results. Why?

0 Answers  


What does DSNDB07 database do?

2 Answers  


what are the SQL codes u freequently got?

2 Answers   Logica CMG,


If the base table underlying a view is restructured, eg. attributes are added, does the application code accessing the view need to be redone?

2 Answers  


What is bind plan?

0 Answers  


How to create backup table in db2?

0 Answers  


i want to delete 20th million record how ?

4 Answers   IBM,


What are the isolation levels possible ?

3 Answers  


My SQL is not performing well. Describe how will you fine tune it?

1 Answers   Accenture,


Categories