Informix Error -9404: User-defined aggregate <aggregate-name> does not exist. </aggregate-name>
Cause and resolution
User-defined aggregate <aggregate-name> does not exist. </aggregate-name>
The named aggregate does not exist in your database. Before you can use a user-defined aggregate, you must create the necessary support functions and register the new aggregate with a CREATE AGGREGATE statement.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9404 fires when a query references a user-defined aggregate that doesn't exist in the database — per the official guidance.
- The aggregate was never registered with a CREATE AGGREGATE statement, per the official guidance — the direct, only cause.
Solutions / Resolution
- Create the necessary support functions and register the aggregate with CREATE AGGREGATE before using it, per the official guidance.
Examples
Referencing an unregistered aggregate
SELECT new_aggr(colA) FROM some_table; -- -9404 if new_aggr was never created
Corrected
CREATE FUNCTION ... ; -- support functions
CREATE AGGREGATE new_aggr WITH (ITER = ..., COMBINE = ...);
SELECT new_aggr(colA) FROM some_table;
Diagnostic Checks
- Check the system catalog for the aggregate name, and register it with CREATE AGGREGATE if missing.
Related Errors / Related Topics
- -9400 — "User-defined aggregate
already exists." The inverse case — registering a name that already exists.
The referenced user-defined aggregate doesn't exist — register it with CREATE AGGREGATE first.