Re: SQL UDF to call RPG without service program
Charles Wilt <[email protected]> Tue, 3 Mar 2026 10:46:54 -0700
| Newsgroups | gmane.comp.lang.as400.rpg |
|---|---|
| Message-ID | <CAJ=Tnc61YLqe5VNP+c5p_K94zpsxwezgM1DowWBd8wSpt6wzUQ@mail.gmail.com> |
Vern,
You can get something back from stored procs or functions.
Functions can only return 1 piece of data (could be an array now-a-days) ,
stored procs can have multiple output (or IN/OUT) parms.
Just like an RPG Program, an SQL stored proc usually does some
significant chunk of work. Whereas a a SQL function or RPG Procedure tends
to do some smaller (usually repeated) work.
Repeated invocation is the point for UDFs, as shown in Roberts example:
SELECT
ivwhid AS "Warehouse",
ivitm# AS "Item Number",
GETUPCHARGEFUNC(ivwhid, ivitm#) AS "Up Charge"
FROM invmasp
WHERE ivwhid = 90
AND ivitm# = 5
ORDER BY 1, 2;
Charles
>
>
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.