× 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 Joep
I read what you wrote
I looked at the IBM manual for V7r1
Still don’t know where these changes/parameters are to be placed

I even dropped the function and created it in the following manner - with the same error
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
EXTERNAL NAME 'PRODPA/ITMMSTSP(GETSTDCOST)'
PARAMETER STYLE GENERAL

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


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of j.beckeringh@xxxxxxxxxxxxxxxxxxxxxxxxxx
Sent: Thursday, January 11, 2018 10:36 AM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Subject: RE: Pointer error when calling external function

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

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD

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.