Informix Error -9610: Illegal attempt to use collection host variable.
Cause and resolution
Illegal attempt to use collection host variable.
You attempted to calculate the cardinality of a data type that is not a collection, incorrectly used a collection host variable by using an untyped collection without assigning a value to it, or used incorrect syntax to create a collection derived table.
Check your manual to determine the correct usage of collections in this context.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9610 fires when a collection host variable is used incorrectly — per the official guidance.
- Calculating cardinality on a data type that isn't a collection, per the official guidance — the first named cause.
- Using an untyped collection host variable without assigning it a value, per the official guidance — the second named cause.
- Incorrect syntax creating a collection-derived table, per the official guidance — the third named cause.
Solutions / Resolution
- Check the manual to determine the correct usage of collections in this context, per the official guidance.
Examples
Calculating cardinality on a non-collection
SELECT CARDINALITY(customer_name) FROM customer; -- -9610: customer_name isn't a collection
Diagnostic Checks
- Identify which collection host-variable operation triggered the error (cardinality, untyped assignment, derived table), and check its correct syntax in the manual.
Related Errors / Related Topics
- -9602 — "Illegal attempt to convert a collection type into another type." A related collection host-variable error, on type conversion specifically rather than cardinality/assignment/derived-table syntax.
A collection host variable was used incorrectly — check the manual for the correct syntax for the specific operation attempted.