SQLRPG Cursors 
Author Message
 SQLRPG Cursors


I am using an SQLRPG (RPG400) cursor to select from a file with 5.5
million rows joing back to a smaller file which should result in a
record set around the 500,000 size. However, it appears to be{*filter*}
at the open cursor statement. When the larger file is reduced in size
the program and cursor appears to run OK although obviously slow due
to the size of processing. Can anyone tell me if there is a limit to
the size of files that you can use in this type of program. Running
the select statement in an interactive SQL session on the AS400 works
OK so I am assuming it must be an RPG limitation?

Any help would be appreciated.

Mon, 18 Jul 2005 11:44:46 GMT
 SQLRPG Cursors

Each SQL interface has its own environment settings  that cause the optimizer to
behave differently so it's not a surprise that embedded SQL may work differently
than STRSQL.  Another thing would be to check if the RPG program call runs in a
different size memory pool other than the STRSQL request.  You might add an
OPTIMIZE FOR n ROWS clause to the SELECT stmt to better inform the optimizer.

I'd highly suggest you take the iSeries SQL Performance workshop.  Find link off
of: http://www-1.ibm.com/servers/eserver/iseries/db2/db2educ_m.htm

If you follow the online education links off this same page, you'll also find
some online SQL performance education.  

Kent Milligan, DB2 & BI team
PartnerWorld for Developers, iSeries

>>> www.iseries.ibm.com/db2

(opinions stated are not necessarily those of my employer)

Mon, 18 Jul 2005 12:10:13 GMT
 [ 2 post ] 

 Relevant Pages 

1. Cursor Cursor Cursor

2. Could not complete cursor operation, because the table schema changed after cursor was declared

3. cursor without cursors

4. Could not complete cursor operation, because the table schema changed after cursor was declared

5. Need Help Please , Invalid Cursor Position Error and Cursor Not Open Error

6. Should I use ODBC cursors or Server cursors?

7. declare curW cursor for EXEC spMySproc - Trying to assign sp resultset to cursor variable

8. client side cursor vs. server side cursor

9. Why declare cursor and open cursor both cost same amount of time

10. Detect if Cursor Opened and Detect if Cursor Allocated

11. Cursor in Trigger - with cursor not open when running second time in the same SQL session

Powered by phpBB® Forum Software