Informix Error -1318: A parameter count mismatch has occurred between the calling function and the called function.
Cause and resolution
A parameter count mismatch has occurred between the calling function and the called function.
Either too many or too few parameters were given in the call to the function. The call is probably in a different source module from the called functions. Inspect the definition of the function, and check all places where it is called to ensure that they use the number of parameters that it declares.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1318 fires when a function call supplies the wrong number of arguments — per the official guidance, either too many or too few. Since the call site often lives in a different source module than the function definition, a mismatch can go undetected until runtime.
- A function call with too few arguments, per the official guidance — the direct, common cause.
- A function call with too many arguments, per the official guidance — the other direct, common cause.
- The function's declared parameter list changed without updating every call site in other source modules, per the official guidance's own framing of why this can slip through.
Solutions / Resolution
- Verify the function's declaration, per the official guidance, for its actual parameter count.
- Review all call sites to confirm they match the expected parameter count, per the official guidance, especially across separate source modules.
Examples
A call with too few arguments
FUNCTION add_days(p_date DATE, p_days INTEGER)
RETURN p_date + p_days;
END FUNCTION
CALL add_days(today())
-- -1318: add_days expects 2 parameters, only 1 was supplied
Diagnostic Checks
- Compare the function's declared parameter count against the argument count at the failing call site, particularly across module boundaries.
Related Errors / Related Topics
- -1317 — "A numeric conversion error has occurred..." A related function-call error, about argument type compatibility rather than count.
- -1320 — "A function has not returned the correct number of values expected by the calling function." A related function-call error, about return-value count rather than argument count.
The function call's argument count doesn't match its declaration — check both across module boundaries.