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



I'm not worried about VARCHAR vs. CHAR since Peter's casting suggestion got
me past that.

The UDF's signature now matches but when it calls the external program it's
dying because 20 parameters are being passed? even though the UDF only has
7 defined? ?!!?

Cause . . . . . : Program QQQSVUSR attempted to call program J5540721Z
with 20 parameters. Program J5540721Z expects a minimum of 7 and a maximum
of 7 parameters.

Recovery . . . : Use the Display Program (DSPPGM) command to determine
the correct number of parameters to pass.

On Tue, Apr 8, 2008 at 2:21 PM, Elvis Budimlic <
ebudimlic@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

There are a number of ways to work around the restriction you've
encountered, but I think you're best off having an RPG program set your
library list and specify it as a target for the UDF (instead of CL). This
way you can declare input as VARCHAR and a single UDF will handle both
CHAR
and VARCHAR input as CHAR is implicitly promoted to VARCHAR by the DB2
engine, when a UDF with matching (CHAR) signature is not found.

As for INOUT on CL... I don't see why that wouldn't work.

HTH, Elvis

Celebrating 11-Years of SQL Performance Excellence on IBM i5/OS and OS/400
www.centerfieldtechnology.com


-----Original Message-----
Subject: Re: External Stored Procedure Vs. External UDF

Thanks for the help and offer of help, Peter, Elvis and Sal.

This looks like the way to go:
SELECT LPCRPO81.J5540721Z( CHAR( 'LPCRP', 10 ), CHAR( '59', 12 ), CHAR(
'PRICING', 8 ), CHAR( ' 59', 8 ), CHAR( '101443', 26 ), CHAR( '1', 16
), CHAR( ' ', 15 ) ) as FOO FROM SYSIBM.SYSDUMMY1;

VARCHAR isn't supported when calling a CL program.

The errors I'm getting now seem to denote progress. I think I'm going to
have to define my function as a SQL function that calls the external
stored
procedure I mentioned. The last parameter is INOUT and it doesn't look
like
I can define that with an external function calling a CL program. Any
correction on that would be appreciated.

Regards,
Alfred

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.





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.