To retrieve data from a query where multiple rows can be returned, a
cursor can be used.
Different programming interface exist for cursors: embedded SQL, CLI,
SQL PL, SQLJ, JDBC.
I we look at the CLI interface, as a statement is first prepared in CLI
before a cursor is associated with it, the cursor attributes are not
known at prepare time. Does it mean that the query path for retrieving
rows is not dependent of the cursor attributes in DB2 UDB LUW? Is there
a second "optimization" step to choose the way the rows returned by the
query will be used by the cursor? Example: the query "select
primary_key from table order by primary_key" can retrieve date directly
from the index part and this could be passed as is directly to the
cursor.
Bernard Dhooghe