when does the SQL statement gets executed when you use
cursor in the application programming ?
Answer Posted / m4io
It depends
If the cursor needs materialization then it gets executed
on "open cursor" like answer 1 and 2 say.
else
the query for the next row gets executed on each fetch.
Materialization happens f.e. when sorts are used.
You can close a cursor without having sqlcode +100.
Suppose a cics transaction reads a table (1.000.000 rows)
via an index : if only 20 rows are needed it will only
request 20 rows (1 each fetch) and then close the cursor.
In batch : if I get 100 pens and need to distribute them to
the people who requested some in order of date-requested, I
will close cursor as soon as 100 pens are distributed.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
How do I delete a column in db2?
When do you specify the isolation level?
Explain package in db2 and its advantages?
What is a bind in db2?
What is ibm db2 used for?
Give a brief description of db2 isolation levels?
What is runstats db2?
What is the advantage in De-normalizing tables in DB2?
What is the difference between drop table and delete table?
How to take backup of table in db2?
What do you mean by rollback?
Mention a credible reason why select* is never given preference in an sql program that has been embedded.
What is a collection in db2?
What is consistency token in db2?
Why do we bind in db2?