Informix Error -9643: Type (type_name) is not hashable.
Cause and resolution
Type (type_name) is not hashable.
Hashing is used in GROUPBY queries and as a mechanism to eliminate duplicate values in DISTINCT and UNION, INTERSECT, or MINUS clauses. You cannot use types declared as non-hashable in these statements.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9643 fires when the named type, declared non-hashable, is used in a GROUP BY, DISTINCT, UNION, INTERSECT, or MINUS context — per the official guidance; hashing is used in GROUP BY queries and to eliminate duplicates in those set operations.
- A non-hashable type used where hashing is required, per the official guidance — the direct, only cause.
Solutions / Resolution
- Avoid using the non-hashable type in GROUP BY, DISTINCT, UNION, INTERSECT, or MINUS, per the official guidance's implication.
Examples
A non-hashable type in GROUP BY
SELECT non_hashable_col, COUNT(*) FROM tab GROUP BY non_hashable_col; -- -9643
Diagnostic Checks
- Check whether the type was declared non-hashable in its CREATE OPAQUE TYPE statement, and avoid it in hash-dependent clauses/operators.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -9643 in this set yet.
A non-hashable type was used in GROUP BY/DISTINCT/UNION/INTERSECT/MINUS, which requires hashing — avoid it in those contexts.