Informix Error -4382
-4382 Cannot expand a structure with an array member.
The ".*" and THROUGH notation cannot be used to expand a record with an array member, except in the LET statement. Error -4382 with this meaning is issued by NewEra.
-4382 Record variables that contain array type elements may not be referenced by the ".*" or THROUGH shorthand, or used as a function parameter.
You can define a record that contains an array as one of its components. However, you must always list that component by its full designation of record.part[n]. The asterisk or THRU notation is only shorthand for a list of the names of the components of the record. It cannot produce the bracketed subscript after the name of the array component.
A record that contains an array component cannot be used as a parameter to a function. However, you can use the array component itself as a function parameter if you spell out its name as record.part. Error -4382 with this meaning is issued by NewEra.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4382 covers two related variants of the same restriction, per the official guidance:
-
NewEra:
.*/THRUnotation can't expand a record with an array member, except in aLETstatement. -
4GL: a record containing an array component can't be referenced via
.*/THRUshorthand, or used as a function parameter — the array component must always be listed with its full designation,record.part[n], since.*/THRUshorthand can't produce a bracketed subscript after an array component's name. -
A record containing an array member, expanded via
.*/THRUnotation, per the official guidance — the direct, only cause.
Solutions / Resolution
- List the array component by its full designation,
record.part[n], per the official guidance, instead of relying on.*/THRUshorthand. - In NewEra, a
LETstatement is the one context where this expansion is still permitted, per the official guidance.
Examples
Expanding a record with an array member
DEFINE rec RECORD
order_id INTEGER,
items ARRAY[5] OF INTEGER
END RECORD
DISPLAY rec.*
-- -4382: rec contains an array member, items
Corrected
DISPLAY rec.order_id, rec.items[1], rec.items[2], rec.items[3], rec.items[4], rec.items[5]
Diagnostic Checks
- Check every
.*/THRUexpansion of a record, and confirm it has no array member; if it does, list the array component explicitly withrecord.part[n].
Related Errors / Related Topics
- -4098 — "Type of expression that is expanded must be class or record." A related expansion-notation error, about the base expression not being a record/class at all, rather than a record with an unsupported array member.
A record with an array member can't be expanded via .*/THRU — list the array component
explicitly instead.