Hello,
I was trying to find the information about when and where should I use
cursors in DB2, no luck. Maybe you can point me to some article that
describes just that (or tell me which page is it in DB2 SQL reference
book, if it's there)? Or maybe you can post a short answer here, if
there's no dedicated article?
Another question would be about scrollable cursors (just found out
about their existence) - what performance gains will I get by using
them over the technique I'm using right now:
<code>SELECT T.* FROM
(SELECT FOO.*, ROWNUM() as ROWNUM
FROM (some query) AS FOO
) AS T
WHERE T.ROWNUM RMIN AND T.ROWNUM < RMAX</code>
I'm using PHP via ibm_db2 PECL module, but also plan to use Python
soon (most probably via PyDB2). Considering to use stored procedures.