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 are write I/Os from the buffer pool executed?

1 Answers  


Which component is responsible for processing sql statements and selecting access paths?

0 Answers  


How do you check for a null value in a db2 column?

2 Answers  


Can you define an Index if the table size less than 10 PAGES?

1 Answers   IBM,


What is a page in db2?

0 Answers  






What is a DB2 catalog?

2 Answers  


What does CURRENTDATA option in bind indicate

1 Answers   IBM,


What is cursor with hold option in db2?

0 Answers  


What is with ur in db2?

0 Answers  


pls explain the precompilation process of cobol-db2 pgm

3 Answers   HCL, IBM,


Select empno, sal from emptbl where empno < 101.By this query can we fetch first 100 recs? where empno is primary key.It won't throw -811 error? if it wont,then what is use of cursor technique while fetching first 100 recs. Please need more clarification.

2 Answers  


How will you return the number of records in table?

0 Answers  


Categories