|
I am having trouble calling an ILE stored procedure that is part of
a service program from an SQL Function.
Short story is that the results are inconsistent. Sometimes it will
correctly determine whether the customer is a store, sometimes not,
and sometimes it gives a decimal data error. The decimal data error
always occurs where the parameter is moved to the key field for the
CHAIN.
The ILE stored procedure works every time when called from RPG.
<<SNIP>>
d AmIAStore pi 1a
d PrmCustNo 9s 0 value
d* Field definitions . . .
<<SNIP>>
Copy member for prototypes:
d/if defined(AmIAStore)
d AmIAStore pr 1a
d CustNo 9s 0 value
d/endif
SQL Create Function:
CREATE FUNCTION spslib/AMIASTOR_F
(Customer Numeric(9,0))
RETURNS char(1)
language rpgle
deterministic
no sql
no external action
external name 'PMBASO/VALID(AMIASTORE)'
parameter style general
program type sub
Invocation:
select mlcst#
, amiastor_f(cast(mlcst# as Numeric(9,0)))
from lmllst01
This should return the customer number and a flag indicating whether
it is a store (Y or N).
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.