Informix Error -4002: Argument n of function "name" is not convertible to its formal parameter's type.
Cause and resolution
Argument n of function "name" is not convertible to its formal parameter's type.
The indicated argument expression or default argument expression is not compatible with the declared type of that function argument. Review the declaration of the function to see what type is expected.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4002 fires when an argument (or default argument) expression passed to a function isn't compatible with the declared type of that parameter — per the official guidance, the argument expression's type and the function's declared parameter type disagree.
- An argument expression whose type can't convert to the function's declared parameter type, per the official guidance — the direct, only cause.
Solutions / Resolution
- Review the declaration of the function to see what type is expected, per the official guidance, and adjust the argument expression accordingly.
Examples
An incompatible argument type
FUNCTION compute(qty INTEGER)
...
END FUNCTION
CALL compute("not a number")
-- -4002: a CHAR literal isn't convertible to INTEGER
Corrected
CALL compute(10)
Diagnostic Checks
- Check the function's declared parameter types, and confirm every call site's argument expressions are convertible to them.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4002 in this set yet.
A function argument's type isn't convertible to its declared parameter type — check the function's declaration and adjust the argument.