Informix Error -4164: The variable is too complex a type to be used in an assignment statement.
Cause and resolution
The variable is too complex a type to be used in an assignment statement.
The type of the variable cannot be used in an assignment.That is, you cannot assign a value (except for the nonvalue NULL) to a BYTE or TEXT variable. You cannot assign any value to an ARRAY variable.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4164 fires when a variable's type doesn't support assignment — per the official guidance, you
can't assign a value (other than the non-value NULL) to a BYTE/TEXT variable, and you
can't assign any value to an ARRAY variable.
- Assigning a non-
NULLvalue to aBYTE/TEXTvariable, per the official guidance — the first named case. - Assigning any value to an
ARRAYvariable as a whole, per the official guidance — the second named case.
Solutions / Resolution
- For
BYTE/TEXTvariables, assign onlyNULL, or use the appropriate BLOB-loading mechanism for actual content. - For
ARRAYvariables, assign individual elements by index instead of the array as a whole.
Examples
Assigning a literal to a BYTE variable
DEFINE photo BYTE
LET photo = "some data"
-- -4164: BYTE variables cannot be assigned non-NULL literals this way
Corrected
LET photo = NULL
Diagnostic Checks
- Check the type of every assignment target, and confirm
BYTE/TEXTtargets are only assignedNULL, andARRAYtargets are assigned by individual element.
Related Errors / Related Topics
- -4091 — "Cannot assign to or refer to an array as a whole. Use indexing to refer to individual elements." A closely related error, covering the same array-assignment restriction specifically.
A variable's type (BYTE/TEXT/ARRAY) doesn't support this assignment — assign NULL for
BLOBs, or assign individual elements for arrays.