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
What is null in db2?
Explain about cursor stability?
How does cobol compile db2 program?
What is difference between isnull and coalesce?
Mention the downsides of page level lock.
Mention the location where the output received from explain statement is stored.
Which component is responsible for db2 startup and shutdown?
What is check constraint in db2?
Which isolation level provides maximum concurrency?
How can the firstname and the lastname from the emp table be concatenated to generate complete names?
How does coalesce work?
What is bind in db2?
How to connect to db2 database from windows command line?
What is precompiler in db2?
Hi Everyone... Under the Logical files, when am working on multiple rec format logical file, I have joined two pf's using the multiple record format logical file concept, but when i run queried the LF only the first mentioned pf records are reflecting and I am not able to see any of the field records specified under the second pf. Kindly let me know whats the reason behind this. Below is the str of LF., R rec PFILE(LOGICAA) CUSTNO CUSTNAME BILL K CUSTNO R rec1 PFILE(LOGICAA1) CUSTNO ADD K CUSTNO .....