Informix Error -4334: The variable variable-name in its current form is too complex to be used in this statement.
Cause and resolution
The variable variable-name in its current form is too complex to be used in this statement.
By "too complex" 4GL means "has too many component parts." In this statement, only simple variables (those that have a single component) can be used. If variable-name is an array, you must provide a subscript to select just one element. If it is a record, you must choose just one of its components. (However, if this statement permits a list of variables, as in the INITIALIZE statement, you can use asterisk or THRU notation to convert a record name into a list of components.)
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4334 fires when a statement requires a simple (single-component) variable, but the given
variable has multiple components — per the official guidance, "too complex" means "has too
many component parts." An array needs a subscript to select one element; a record needs one
of its components chosen. Statements that permit a list of variables (such as INITIALIZE)
can instead use asterisk or THRU notation to convert a record name into a list.
- An array used without a subscript where a simple variable is required, per the official guidance — the first named case.
- A record used without selecting a single component where a simple variable is required, per the official guidance — the second named case.
Solutions / Resolution
- Provide a subscript to select one array element, per the official guidance.
- Choose one component of the record, per the official guidance.
- If the statement permits a list (e.g.
INITIALIZE), use asterisk orTHRUnotation, per the official guidance.
Examples
A record used as a whole where a simple variable is required
DEFINE rec RECORD
qty INTEGER,
price DECIMAL
END RECORD
CALL somefunc(rec)
-- -4334: rec has multiple components; somefunc expects a simple variable
Corrected
CALL somefunc(rec.qty)
Diagnostic Checks
- Check the flagged variable's type, and provide a subscript (array) or select a single component (record) as required.
Related Errors / Related Topics
- -4323 — "The variable variable-name is too complex a type to be used in an assignment statement." A related complex-type restriction, about assignment specifically.
- -4340 — "The variable variable-name is too complex a type to be used in an expression." A closely related error covering the same condition in the NewEra-specific context.
A record or array is used where a simple variable is required — provide a subscript or select a single component.