Informix Error -4311
-4311 The variable "variable-name" was not defined as a record.
It cannot be used in this fashion.The variable name that is shown is being used with THRU (or THROUGH) notation or with .* notation, but is not defined as a record. Check that the variable name is the one that you intended. If it is, find the place where it is defined (which may be in a global definition file included with the GLOBALS statement) and find out why it is no longer defined as a record.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4311 fires when a variable used with THRU/THROUGH or .* notation isn't defined as a
record — per the official guidance, this is the classic 4GL-context version of this check.
- A variable used with
THRU/THROUGHor.*that isn't declared as a record, per the official guidance — the direct, only cause.
Solutions / Resolution
- Check that the variable name is the one intended, per the official guidance.
- Find where it's defined (possibly in a
GLOBALS-included file) and find out why it's no longer defined as a record, per the official guidance.
Examples
Expanding a non-record variable
DEFINE qty INTEGER
DISPLAY qty.*
-- -4311: qty is not defined as a record
Corrected
DEFINE rec RECORD
qty INTEGER,
price DECIMAL
END RECORD
DISPLAY rec.*
Diagnostic Checks
- Check the declaration of any variable used with
THRU/.*, including anyGLOBALSfile, and confirm it's genuinely a record.
Related Errors / Related Topics
- -4161 — "This variable has not been defined as a record or object." A closely related error in the NewEra-specific context, covering the same condition for records and objects.
A variable used with THRU/.* isn't defined as a record — check its declaration, including
any GLOBALS file.