Informix Error -33074: Explicit cast, either with CAST keyword or (::) operator, is not allowed in client collections.
Cause and resolution
Explicit cast, either with CAST keyword or (::) operator, is not allowed in client collections.
You cannot use explicit casts in client collections. For example, the following example is not allowed:
$client collection list(row( a udt_1, b list(int))) mylist; $insert into table (:mylist) values (CAST(1 AS udt_1), list{1,2,3}); $insert into table (:mylist) values (1::udt_1, list{1,2,3});
When you enter esql -e client.ec, you get the following errors:
esqlc: "client.ec", line 2: Error -33074: Cannot use CAST in client collections.
esqlc: "client.ec", line 3: Error -33074: Cannot use CAST in client collections.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-33074 fires when a client collection literal uses an explicit cast (CAST keyword or
:: operator) on one of its elements — per the official guidance, explicit casts aren't
allowed there.
- A
CAST(...)or::-operator cast used inside a client collection literal, per the official guidance — the direct, only cause.
Solutions / Resolution
- Remove the explicit cast from the client collection element, per the official guidance, relying on implicit conversion instead.
Examples
An explicit cast inside a client collection
$client collection list(row(a udt_1, b list(int))) mylist;
$insert into table (:mylist) values (CAST(1 AS udt_1), list{1,2,3});
-- -33074: explicit CAST inside a client collection literal
$insert into table (:mylist) values (1::udt_1, list{1,2,3});
-- -33074: explicit :: cast inside a client collection literal
Corrected
$insert into table (:mylist) values (1, list{1,2,3});
Diagnostic Checks
- Check client collection literals for
CAST(...)/::-operator usage on their elements, and remove it.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -33074 in this set yet.
A client collection literal used an explicit cast on one of its elements — remove the
CAST/:: usage and rely on implicit conversion.