Informix Error -4323: The variable variable-name is too complex a type to be used in an assignment statement.
Cause and resolution
The variable variable-name is too complex a type to be used in an assignment statement.
The named variable is a record or an array. 4GL does not support the assignment of whole records or arrays. In the case of a record, you must assign the individual record components, or you can assign groups of components to groups of components using asterisk notation. In the case of an array, you must use a subscript to designate a single array element. This error is not produced by any version of 4GL later than Version 4.1.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4323 fires when a variable that's a record or an array is assigned as a whole — per the official guidance, 4GL doesn't support assigning whole records or arrays; the official guidance also notes this error isn't produced by any 4GL version later than 4.1.
- A record assigned as a whole, per the official guidance — must instead assign individual components, or groups of components via asterisk notation.
- An array assigned as a whole, per the official guidance — must instead use a subscript to designate a single element.
Solutions / Resolution
- For a record, assign individual components, or use asterisk notation for groups of components, per the official guidance.
- For an array, use a subscript to assign a single element, per the official guidance.
Examples
Assigning a whole record
DEFINE rec1, rec2 RECORD
order_id INTEGER,
order_date DATE
END RECORD
LET rec1 = rec2
-- -4323: whole-record assignment is not supported
Corrected
LET rec1.* = rec2.*
Diagnostic Checks
- Check for any assignment targeting a whole record or array, and rewrite it using component assignment, asterisk notation, or array subscripting.
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.
- -4164 — "The variable is too complex a type to be used in an assignment statement." A
closely related error covering the same restriction in the NewEra-specific context, also
including
BYTE/TEXTvariables.
A whole record or array is used as an assignment target — assign individual components/elements instead.