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



Hi Alan,

In the SQL reference manual it is specified under 'CREATE FUNCTION':

GENERAL WITH NULLS
All applicable parameters are passed. The parameters are defined to be in
the following order:
v The first N parameters are the input parameters that are specified on
the
CREATE FUNCTION statement.
v An additional argument is passed for an indicator variable array.
v A parameter for the indicator variable for the result.
Note that the result is returned as a value of a C value returning
function.
For example:
return_val func(parameter-1, parameter-2, ...)

So you need to specify two extra parameters (the indicator variable array
for the input and the indicator variable for the result).

Joep Beckeringh
Software architect
Pantheon Automatisering B.V.
Heerenveen

Alan Shore <ashore@xxxxxxxx>

11-01-2018 16:30

RE: Pointer error when calling external function

Thanks Joep
I thought it was more to do with the function as I had tested the
procedure in a small test RPG program with no problems
I dropped the function and created it again with COMMIT - see below
But my test is STILL failing with the same problem (using STRDBG)
You said
And you should be supplying extra parameters for a null map for the
input parameters and a null indicator variable for the result.

I didn’t make any changes for this
Is this the problem?
Where would this change need to be?



CREATE FUNCTION PRODPA.EBSCST (
CHAR(4),
CHAR(6),
CHAR(2),
DECIMAL(2, 0),
CHAR(2),
CHAR(1),
CHAR(2) )
RETURNS DECIMAL(21, 6)
LANGUAGE RPGLE
SPECIFIC PRODPA.EBSCST
DETERMINISTIC
NO SQL
RETURNS NULL ON NULL INPUT
NOT FENCED
EXTERNAL NAME 'PRODPA/ITMMSTSP(GETSTDCOST)'
PARAMETER STYLE GENERAL WITH NULLS

Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
‘If you're going through hell, keep going.’
Winston Churchill


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.