Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

iSeries / AS400 FAQ : (Category) Programming : (Category) VB/ASP : How can I return a result set from RPG to Visual Basic?

0
Posted

iSeries / AS400 FAQ : (Category) Programming : (Category) VB/ASP : How can I return a result set from RPG to Visual Basic?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.