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

Describe what a storage group(STOGROUP) is?

2 Answers  


what is contained in the DB2 node lock file? A) data base names B) data base users names C) license keys D) server names

5 Answers   Accenture,


What is the physical storage length of time data type?

0 Answers  


wt is view ? wht r the restrictions for view ?

3 Answers   Verizon,


OUTER JOINS USED TO GET MATCHING AND NONMATCHING ROWS FORM 2 OR MORE TABLES BASED ON COLUMNS. SIMPLE JOINS ALSO DO THE SAME THEN WHAT IS THE USE OF OUTER JOINS.

1 Answers   Syntel,






Return code 100 means?

6 Answers   Cap Gemini,


Explain correlated sub-queries.

0 Answers  


I need to view the number of tables existing under one particular Owner. Is it possible? If so, pl give the SQL query for this?

2 Answers  


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

2 Answers  


DB2: A calls B once sucessfull and second time when it calls says curson is open why is it so?

1 Answers   IBM,


What r the comman abends in db2, jcl and cobol???????

0 Answers   Mphasis,


What is buffer pool?

0 Answers  


Categories