Informix Error -9409: User-defined aggregate <aggregate-name> has too many arguments. </aggregate-name>
Cause and resolution
User-defined aggregate <aggregate-name> has too many arguments. </aggregate-name>
The user-defined aggregate in your SELECT statement specifies too many arguments
Make sure that the user-defined aggregate of the SELECT statement provides the correct number of arguments (one or possibly two, if the aggregate includes a set-up argument).
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9409 fires when a user-defined aggregate is called in a SELECT statement with more arguments than it expects — per the official guidance.
- A call to the aggregate with too many arguments, per the official guidance — the direct, only cause.
Solutions / Resolution
- Provide the correct number of arguments (one, or two if the aggregate includes a set-up argument), per the official guidance.
Examples
Calling an aggregate with an extra argument
SELECT new_aggr(colA, colB, colC) FROM some_table; -- -9409 if only 1 or 2 expected
Corrected
SELECT new_aggr(colA, colB) FROM some_table;
Diagnostic Checks
- Check the aggregate's CREATE AGGREGATE definition for whether it expects one or two arguments, and supply the correct count in the call.
Related Errors / Related Topics
- -9408 — "User-defined aggregate
has no arguments." The inverse case — calling the aggregate with zero arguments.
The aggregate was called with more arguments than it expects — supply the correct count (one, or two with a set-up argument).