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
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 |
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 |
How are write I/Os from the buffer pool executed?
Which component is responsible for processing sql statements and selecting access paths?
How do you check for a null value in a db2 column?
Can you define an Index if the table size less than 10 PAGES?
What is a page in db2?
What is a DB2 catalog?
What does CURRENTDATA option in bind indicate
What is cursor with hold option in db2?
What is with ur in db2?
pls explain the precompilation process of cobol-db2 pgm
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.
How will you return the number of records in table?