Informix Error -4348
-4348 This type of aggregate must be applied to an expression,
not '*'. Only PERCENT and COUNT aggregates use '*'.An aggregate function in this statement is one of those, such as MIN and SUM, that must be applied to a specific column or to an expression involving specific columns. The asterisk notation in an SQL statement means "the whole row." With an aggregate function, it is useful only when counting entire rows.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4348 fires when an aggregate function that requires a specific column/expression (such as
MIN or SUM) is given * instead — per the official guidance, * means "the whole row,"
which is only meaningful with COUNT and PERCENT aggregates.
- An aggregate like
MIN/SUMapplied to*instead of a specific column/expression, per the official guidance — the direct, only cause.
Solutions / Resolution
- Apply the aggregate to a specific column or expression instead of
*.
Examples
SUM applied to *
SELECT SUM(*) FROM order_items;
-- -4348: SUM needs a specific column, not *
Corrected
SELECT SUM(qty) FROM order_items;
Diagnostic Checks
- Check every aggregate function's argument, and confirm
*is used only withCOUNTorPERCENT.
Related Errors / Related Topics
- -4341 — "Aggregate functions are only allowed in reports and SELECT statements." A related aggregate-function restriction, about where aggregates can be used rather than what argument they accept.
An aggregate function that requires a specific column/expression was given * instead — only
COUNT/PERCENT support *.