Informix Error -664: Wrong number of arguments to system function function-name.
Cause and resolution
Wrong number of arguments to system function function-name.
You have specified an incorrect number of arguments for the function function_name. Check that you are passing the correct number of arguments to the function.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-664 fires when a built-in (system) function is called with a different number of arguments than it accepts — per the official guidance, check that the correct argument count is being passed.
- Too many arguments passed to a built-in function, expecting an optional or overloaded form that doesn't actually exist for this function.
- Too few arguments passed, omitting a required argument the function needs.
- Confusion between similarly-named functions with different argument counts — for example, a function overloaded elsewhere (in a different SQL dialect or a UDR of the same name) that accepts a different number of arguments than Informix's built-in version.
Solutions / Resolution
- Check the exact argument count the function requires, per the official guidance, and correct the call to match.
- Consult the function's documented signature if the required count isn't obvious from memory, rather than guessing based on a similarly-named function from elsewhere.
Examples
Too many arguments
SELECT SUBSTR(title, 1, 10, 'extra') FROM documents;
-- -664: SUBSTR takes 2 or 3 arguments, not 4
Corrected
SELECT SUBSTR(title, 1, 10) FROM documents;
Diagnostic Checks
- Identify the specific
function-namenamed in the error and check its documented argument count/signature against the actual call.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -664 in this set yet.
Check the function's actual documented signature rather than assuming an argument count from a similarly-named function elsewhere.