Re: UDFx error 42884
Charles Wilt <[email protected]> Mon, 6 Apr 2026 13:30:10 -0600
| Newsgroups | gmane.comp.lang.as400.rpg |
|---|---|
| Message-ID | <CAJ=Tnc5hTeC6dsVkb-XrTmOpamhYqD7m6mx69X=ULkr3r1MVng@mail.gmail.com> |
You've defined
CREATE OR REPLACE FUNCTION mylib.ZGIACART_Z (
CODART CHAR(17) ,
DATARIF decimal(8, 0)
)
But are calling with a VARCHAR
mylib.ZGIACART_Z('020146 ' , 20261231 ))
And in fact your RPG PI has varchar
pCodArt varchar(17) const;
Lastly, you might need to include the decimal point for Db2 to interpret
20261231 as packed.
20261231.
optionally you can cast the literals to the correct type.
Charles
On Mon, Apr 6, 2026 at 10:50 AM gio.cot via RPG400-L <
[email protected]> wrote:
> Hi all
>
> I'm plyaing with UDFx
>
>
>
> I have registered ths UDF
>
>
>
> CREATE OR REPLACE FUNCTION mylib.ZGIACART_Z (
>
> CODART CHAR(17) ,
>
> DATARIF decimal(8, 0)
>
> )
>
> RETURNS TABLE (
>
> mag char ( 2),
>
> art char ( 17),
>
> cau decimal ( 3 , 0),
>
> GIACENZA DECIMAL( 15 , 3)
>
> )
>
> LANGUAGE RPGLE
>
> PARAMETER STYLE general
>
> -- SPECIFIC GIACENZART
>
> NOT DETERMINISTIC
>
> -- MODIFIES SQL DATA
>
> no sql
>
> DISALLOW PARALLEL
>
> EXTERNAL NAME 'mylib/ZGIACART';
>
>
>
>
>
> This the SQLRPGLE input :
>
>
>
> **FREE
>
> ctl-opt dftactgrp(*no) option(*nodebugio) ACTGRP(*NEW) ;
>
>
>
> // ctl-opt DFTACTGRP(*NO) ACTGRP(*NEW);
>
>
>
> dcl-pi *n;
>
> pCodArt varchar(17) const;
>
> pDataRif packed(8: 0) const ;
>
> // Output fields
>
> oMag char(2);
>
> oArt char(17);
>
> oCau packed( 3 : 0 );
>
> oGiacenza packed(15:3);
>
> // Null indicators
>
> nCodArt ind const;
>
> nDataRif ind const;
>
> nMag ind const;
>
> nArt ind const;
>
> nCau ind const;
>
> nGiacenza ind;
>
> // SQL parms
>
> xsqlState char(5);
>
> funcName varchar(517) const;
>
> specName varchar(128) const;
>
> msgText varchar(1000);
>
> callType int(10) const;
>
> end-pi;
>
>
>
>
>
> when i try to invoke the UDF via Sql
>
>
>
> select * from table(mylib.ZGIACART_Z('020146 ' , 20261231 ))
> as
> t;
>
>
>
> i receive Message: SQL: 42884
>
> [SQL0440] The routine ZGIACART in mylib was not found with the specified
> parameters. Cause. . . . . : A function or procedure with the specified
> name
> and compatible arguments was not found. This could be due to a permission
> error. Correction . . . : Specify the correct number and type of parameters
> in the CALL statement, CREATE OR REPLACE statement, or function invocation.
> Retry the request.
>
>
>
> Where am I wrong ?
>
>
>
> Thanks in advance
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> This is the RPG programming on IBM i (RPG400-L) mailing list
> To post a message email: [email protected]
> To subscribe, unsubscribe, or change list options,
> visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: [email protected]
> Before posting, please take a moment to review the archives
> at https://archive.midrange.com/rpg400-l.
>
> Please contact [email protected] for any subscription related
> questions.
>
>
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact [email protected] for any subscription related questions.