× 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.



On 11/8/2017 2:18 PM, Justin Taylor wrote:
Overloading means you have multiple procedures with the same name, but different number and/or types of parameters. Which procedure you get depends on the parameters you specify on the call.

That's exactly how I handle Dan's situation.

Day 1: CREATE PROCEDURE MYPROC (parm1, parm2) external 'lib/mypgm'
Executing the SQL statement CALL MYPROC (:p1, :p2); invokes RPG
program MYPGM which has 2 parameters.

Day 9: CREATE PROCEDURE MYPROC (parm1, parm2, parm3) external 'lib/mypgm3'
Executing the SQL statement CALL MYPROC (:p1, :p2); invokes RPG
program MYPGM which has 2 parameters.
Executing the SQL statement CALL MYPROC (:p1, :p2, :p3); invokes RPG
program MYPGM3 which has 3 parameters.

Existing callers don't change, and new callers don't know they are
running a new program. Transplant the guts out of MYPGM and put them
into MYPGM3 and all you leave in MYPGM is a 3 parameter call to MYPGM3.
Which leaves the actual program logic in one place, with MYPGM as a
shell left behind for compatibility purposes.

I suspect if Dan could have done that, he wouldn't have been asking
about parameter lists, so I reckon his web team are using JT400 or
similar to directly CALL the RPG programs rather than use an SQL stored
procedure as the framework.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.