What it means
When you CALL a procedure or use a function, Db2 looks for a definition with that name, in the right schema, whose parameters fit the arguments you pass, and which you are authorized to run. If none fits, it returns -440 with SQLSTATE 42884. The message tells you whether it was looking for a FUNCTION or a PROCEDURE, and the name.
A wrong argument count or data type is enough to cause it, even when a routine of that name exists. Less common causes are a passthrough-only expression run while CURRENT QUERY ACCELERATION is NONE, and features the application compatibility level does not allow.
Typical causes
- A misspelled routine name, or the routine was never created here.
- Wrong schema qualifier, or an unqualified name whose schema is not in the SQL path.
- The number of arguments differs from the routine definition.
- An argument has a data type the parameter does not accept, for example a CHAR literal for an INTEGER parameter.
- The caller lacks EXECUTE authority on the routine.
- The package's application compatibility level does not support something the statement uses.
How to fix it
- Read the routine type and name in the message.
- Check SYSIBM.SYSROUTINES for that name: schema, number of parameters and their types (SYSIBM.SYSPARMS).
- Qualify the name, or fix the PATH bind option or SET CURRENT PATH.
- Match the argument count and types to the definition; add a CAST where needed.
- Ask for EXECUTE authority on the routine if that is missing.
- For a passthrough-only expression, set CURRENT QUERY ACCELERATION to ELIGIBLE, ENABLE or ALL; for compatibility level issues, rebind at a level that supports the feature.
Example
Illustrative only; names and values are invented.
CALL PAYSCH.CALC_TAX(:WS-AMOUNT)
-- procedure is defined with 2 parameters
-- SQLCODE -440, NO AUTHORIZED PROCEDURE BY THE NAME CALC_TAX ...
-- SQLSTATE 42884