Sorry for the bother.
I have an SQLRPGLE based service program that "works" when called from an RPGLE based program, but when the same service program is wrapped in an SQL function, then used within STRSQL it fails with a data decimal error.
I don't know how much info would be sufficient, here, but, the SQLRPGLE object (P1) has this procedure identifier:
0008.39 D BBPLSTSTS PR 60A
0008.40 D APPYER 2S 0 CONST
0008.41 D APPNBR 8S 0 CONST
0008.50 P BBPLSTSTS B EXPORT
0008.51 D BBPLSTSTS PI 60A
0008.52 D APPYER 2S 0 CONST
0008.53 D APPNBR 8S 0 CONST
The SQL function (F1) that sits over it was created as:
Create function xlib/F1 (APPYER DEC(2,0),
APPNBR DEC(8,0))
Returns char(60)
Language rpgle
Not deterministic
External name 'XLIB/P1(BBPLSTSTS)'
Parameter style General
And the STRSQL statement it fails upon is:
select x.bppyer, x.bppcnb,
BBFlststs(x.bppyer, x.bppcnb)
from bplib/bp300ap x
where x.bppyer = 05 and x.bppcnb = 71
Is the error obvious?
I have an SQLRPGLE based service program that "works" when called from an RPGLE based program, but when the same service program is wrapped in an SQL function, then used within STRSQL it fails with a data decimal error.
I don't know how much info would be sufficient, here, but, the SQLRPGLE object (P1) has this procedure identifier:
0008.39 D BBPLSTSTS PR 60A
0008.40 D APPYER 2S 0 CONST
0008.41 D APPNBR 8S 0 CONST
0008.50 P BBPLSTSTS B EXPORT
0008.51 D BBPLSTSTS PI 60A
0008.52 D APPYER 2S 0 CONST
0008.53 D APPNBR 8S 0 CONST
The SQL function (F1) that sits over it was created as:
Create function xlib/F1 (APPYER DEC(2,0),
APPNBR DEC(8,0))
Returns char(60)
Language rpgle
Not deterministic
External name 'XLIB/P1(BBPLSTSTS)'
Parameter style General
And the STRSQL statement it fails upon is:
select x.bppyer, x.bppcnb,
BBFlststs(x.bppyer, x.bppcnb)
from bplib/bp300ap x
where x.bppyer = 05 and x.bppcnb = 71
Is the error obvious?