Return to the RPG Tips
RPGLE Stored Procedures
For your RPGLE member do something like: * Declare a cursor for the result set C/Exec SQL C+ Declare csMain For C+ Select * From MyFile C+ For Fetch Only C/End-Exec * Open the cursor C/Exec SQL C+ Open csMain C/End-Exec * Return with the result set C/Exec SQL C+ Set Result Sets Cursor csMain C/End-Exec Then you'll need to declare the stored procedure with an SQL statement: Create Procedure ProcLib/ProcName Language RPGLE Not Deterministic Reads SQL Data External Name PgmLib/PgmName Of course, you can also use OpsNav for the "CREATE PROCEDURE" statement.
[report a broken link by clicking here]