|
Yes - I looked it up again in the SQL reference.
https://www.ibm.com/docs/en/i/7.5.0?topic=statements-create-function-external-scalar
For PARAMETER STYLE SQL to work, your program needs the following
parameters - quote from the SQL reference:
The parameters are defined to be in the following order:function.
- n parameters for the input parameters that are specified for the
- A parameter for the result of the function.
- n parameters for indicator variables for the input parameters.
- A parameter for the indicator variable for the result.
- A CHAR(5) output parameter for SQLSTATE. ...
- A VARCHAR(517) input parameter for the fully qualified function name.
- A VARCHAR(128) input parameter for the specific name.
- A VARCHAR(1000) output parameter for the message text.
And that works quite good. But you will need a "wrapper" program or
procedure if you don't want to modify the original program.
If you have specific entry parameters, please show them, so we can try to
help you.
HTH
Daniel
Am 22.01.2026 um 17:23 schrieb Daniel Gross <daniel@xxxxxxxx>:"DB2SQL".
Yes - that shouldn't be a big problem.
You have to use
PARAMETER STYLE DB2SQL
in the function definition. AFAIK "SQL" does also work, but I always use
the function.
With this you will have a parameter the contains the return value for
presentation:
Still one of the best resources for UDFs and UDTFs is Scott's
https://www.scottklement.com/presentations/RPG%20User%20Defined%20Functions%20&%20Table%20Functions.pdf
a *PGM - it differs only in the EXTERNAL NAME clause.
Scott's example is with a *SRVPGM procedure, but it works the same with
list
HTH
Daniel
Am 22.01.2026 um 17:09 schrieb Justin Taylor <jtaylor.0ab@xxxxxxxxx>:
I'd wager this is a long shot, but it can't hurt to ask.
I have an RPGLE *PGM that has a parameter that's basically an output
parameter. Is there a way to create an SQL UDF that can use that *PGM
object and make that output parameter an actual return value?
*SRVPGM is off the table. Don't ask... :(
Thanks
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
related questions.To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
list--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxxrelated questions.
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2026 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.