Informix Error -4060: Fewer actual arguments than formal arguments without defaults for function "name".
Cause and resolution
Fewer actual arguments than formal arguments without defaults for function "name".
This statement invokes function name, but it specifies fewer argument expressions than were called for in the declaration of function name. Check the syntax of the argument list. Review the declaration of the function for the expected number and type of arguments.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4060 fires when a function call passes fewer argument expressions than the function's declaration requires (and the missing ones have no defaults) — per the official guidance, the call specifies fewer arguments than called for.
- A function call with fewer argument expressions than the function's declared parameter list requires, per the official guidance — the direct, only cause.
Solutions / Resolution
- Check the syntax of the argument list, per the official guidance.
- Review the declaration of the function for the expected number and type of arguments, per the official guidance.
Examples
Too few arguments in a call
FUNCTION save(id INTEGER, name CHAR(30)) RETURNING INTEGER
...
END FUNCTION
CALL save(1001)
-- -4060: save() requires a second argument with no default
Corrected
CALL save(1001, "Widget")
Diagnostic Checks
- Check the argument count at every call site against the function's declared parameter list, accounting for any defaulted parameters.
Related Errors / Related Topics
- -4059 — "More actual arguments than formal arguments for function "name"." The mirror-image error, about too many arguments rather than too few.
A function call passes fewer arguments than required (with no defaults for the missing ones) — check the declaration's parameter list.