× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Yes, you can call a stored procedure from RPGLE.

1 - If it does not use result sets then a simple
exec sql call myproc;
should work.

2 - If it returns result sets then you cannot use imbedded SQL.  You'll 
have to use SQL-CLI where the CLI stands for Call Level Interface.

Now, if you want to take an existing RPGLE program and make it a stored 
procedure, and even have it return result sets to a different program, 
that's no big deal.  In fact, an old S/36 programmer here who has long 
moved over to the dark side of PC development wrote his first RPG program 
in years to do a program that returned a result set.

DPARM1            DS 
DINPUT                           1A 
DPARM2            DS                  OCCURS(1) 
DOUTPUT                         11A 
DROW              S              1  0 
C     *ENTRY        PLIST 
C                   PARM                    PARM1 
C     INPUT         IFEQ      'A' 
C                   MOVE      '1'           OUTPUT 
C                   ELSE 
C                   MOVE      'TEST OUTPUT' OUTPUT 
C                   ENDIF 
C                   MOVE      1             ROW 
C/EXEC SQL SET RESULT SETS ARRAY :PARM2 FOR :ROW ROWS
C/END-EXEC 
C                   RETURN 

Then there's a little work like
STRSQL
CREATE PROCEDURE ... to register this program as a stored procedure.

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.