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

Can you search give an array in the WHERE clause of a db2 query?

1 Answers  


What is copy book?

1 Answers   Thomson Reuters,


Is db2 relational database?

0 Answers  


In a DB2-CICS program which is acts as co-ordinator and which is participant?

1 Answers   IBM,


What is the significance of the CURSOR WITH HOLD clause in a cursor declaration?

4 Answers  


What happens in bind step in a db2 program?

0 Answers  


What is meant by the attachment facility?

3 Answers  


query to just fetch first matching row and stop execution. once one matching row is found ..no more records should be checked.. if the first record is matching.. the query must stop

2 Answers   IBM,


How can you do the explain of a dynamic sql statement?

0 Answers  


Can any one tell me about Restart logic in DB2.

2 Answers  


How and when does the db2 enforces the unique key?

0 Answers  


Which is faster delete or truncate?

0 Answers  


Categories