Informix Error -4439: You cannot SELECT into record record because element name is a record or an array.
Cause and resolution
You cannot SELECT into record record because element name is a record or an array.
The INTO clause can name only simple variables. The use of asterisk or THRU notation is a shorthand for listing all the component fields of a record. The resulting list of fields must consist of simple variables. In this case, the field name is not simple. Perhaps you have referred to the wrong record. If not, you will have to list the name component separately, specifying one or more of its component parts.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4439 fires when a SELECT's INTO clause expands a record via .*/THRU, but one of the
resulting component fields is itself a record or array — per the official guidance, INTO can
only name simple variables, and expansion shorthand must resolve entirely to simple variables.
- A record component expanded via
.*/THRUinINTOthat's itself a record or array, per the official guidance — the direct, only cause.
Solutions / Resolution
- Confirm the correct record was referenced, per the official guidance.
- List the nested component's own parts individually, per the official guidance, rather than relying on the outer expansion alone.
Examples
A record component that's itself a record
DEFINE rec RECORD
order_id INTEGER,
shipping RECORD
method CHAR(20),
cost DECIMAL
END RECORD
END RECORD
SELECT order_id, ship_method, ship_cost INTO rec.*
FROM orders WHERE order_id = 1001;
-- -4439: rec.shipping is itself a record, not a simple variable
Corrected
SELECT order_id, ship_method, ship_cost
INTO rec.order_id, rec.shipping.method, rec.shipping.cost
FROM orders WHERE order_id = 1001;
Diagnostic Checks
- Check every record expanded via
.*/THRUin anINTOclause, and list any nested record/array component's own parts individually.
Related Errors / Related Topics
- -4334 — "The variable variable-name in its current form is too complex to be used in this statement." A related complex-type restriction, about the same simple-variable requirement in other statement contexts.
- -4340 — "The variable variable-name is too complex a type to be used in an expression." A related complex-type restriction in the NewEra-specific context.
A record expanded via .*/THRU in INTO has a component that's itself a record/array —
list its own parts individually.