I have an SQL function that the system cannot seem to find.
I create the procedure with the following statement:
CREATE FUNCTION RSHPROBJ/ONTIM ( CM CHAR(4), TRAC CHAR(14), STDATE DECIMAL(8,0), ENDATE DECIMAL(8,0), CNTTYP CHAR(2), STPTYP CHAR(2) ) RETURNS DECIMAL(7,0) LANGUAGE RPGLE SPECIFIC RSHPROBJ/ONTIM DETERMINISTIC NO SQL CALLED ON NULL INPUT NO EXTERNAL ACTION EXTERNAL NAME 'RSHPROBJ/SQLSRVPGM3(ONTIM)' PARAMETER STYLE SQL
I call it with the following:
SELECT DUMMY1 , ONTIM('01 ', '8640 ', 20111101, 20111102, 'LT', 'AL') FROM dummy
and it is not found. I see it with the proper 6 parameters in iSeries navigator
The RPGLE program has the following entries:
DONTIM PR D* * Input Vars D CM Like(BSCM) D Tractor Like(BSTRA) D StDate 8 0 D EnDate 8 0 D CntType 2A D StpType Like(BSSTYP) .....D* * Return Var D OTCOUNT 7 0 D* * Input Vars Null Indicators D CMi 5I 0 D Tri 5I 0 D SDi 5I 0 D EDi 5I 0 D CTi 5I 0 D STi 5I 0 D* * Output Var Null Indicator D Rtni 5I 0 D* * SQL status Vars D SQLState 5 D SQLFuncName 139 D SQLSpecName 128 D SQLMsg 70 Varying
BSCM is 4A
BSTRA is 14A
BSSTYP is 2A
The module compiles and is in SQLSRVPGM3 and the ONTIM procedure is exported.
Everything seems to agree, but it is not found.
Error is "ONTIM in *LIBL type *N not found." and RSHPROBJ is in my *LIBL