iSeries / AS400 FAQ : (Category) Programming : (Category) VB/ASP : How can I return a result set from RPG to Visual Basic?
Here’s a couple of examples of RPGIII programs (SQLRPG) that return result sets. It works fine in ILE RPG too but I haven’t got an example handy. RPG code for program TEST01QA (compiled using CRTSQLRPG on a box with the licensed program 5769ST1 DB2 Query Mgr and SQL DevKit for AS/400 loaded – this is not required at run time). IV99999 DS 4 I 1 1 OUT1 I 2 9 OUT2 I B 10 130OUT3 C MOVE 4 ROW 10 C 1 OCUR V99999 C MOVE ‘A’ OUT1 C MOVEL’SHAWM ‘OUT2 C Z-ADD99 OUT3 C 2 OCUR V99999 C MOVE ‘B’ OUT1 C MOVEL’WARRM ‘OUT2 C Z-ADD100 OUT3 C 3 OCUR V99999 C MOVE ‘C’ OUT1 C MOVEL’ENRIGHTR’OUT2 C Z-ADD101 OUT3 C 4 OCUR V99999 C MOVE ‘D’ OUT1 C MOVEL’DAVIESG ‘OUT2 C Z-ADD29876 OUT3 C/EXEC SQL SET RESULT SETS ARRAY :V99999 FOR :ROW ROWS C/END-EXEC C* MOVEL*ON *INLR C RETRN SQL CREATE PROCEDURE: CREATE PROCEDURE QGPL/TEST4 RESULT SETS 1 LANGUAGE RPG SPECIFIC QGPL/TEST4 NOT DETERMINISTIC CONTAINS SQL EXTERNAL NAME SHAWM/TEST01QA PARAMETER STYLE GENERAL Slightly more complex result set processing This one ha
Related Questions
- iSeries / AS400 FAQ : (Category) Programming : (Category) RPG : I am linking to some procedures in some modules, when are these procedures loaded?
- iSeries / AS400 FAQ : (Category) Programming : (Category) VB/ASP : How can I return a result set from RPG to Visual Basic?
- iSeries / AS400 FAQ : (Category) Programming : (Category) RPG : How can I convert a character string into a numeric value?