Informix Error -4370: The variable variable-name cannot be used in validation.
Cause and resolution
The variable variable-name cannot be used in validation.
The VALIDATE statement operates on only simple variables; it cannot accept records or arrays. If you have named a record, you can use asterisk notation or THRU notation as shorthand for a list of the component fields of the record. However, if a record component is itself a record, you must list its components individually as well.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4370 fires when VALIDATE is given a record or array as a whole — per the official guidance,
VALIDATE only operates on simple variables; a record can be expanded via asterisk or THRU
notation as shorthand for its component list, but any component that's itself a record must
also be listed individually.
VALIDATEgiven a record or array directly, without expansion, per the official guidance — the direct, only cause.
Solutions / Resolution
- Use asterisk or
THRUnotation to expand a record into its component list, per the official guidance, listing any nested record's own components individually too.
Examples
VALIDATE on a whole record
DEFINE rec RECORD
qty INTEGER,
price DECIMAL
END RECORD
VALIDATE rec
-- -4370: rec is a RECORD, not a simple variable
Corrected
VALIDATE rec.*
Diagnostic Checks
- Check every
VALIDATEtarget, and expand any record/array into its simple-variable component list.
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 covering the same general principle across multiple statement types.
VALIDATE was given a record or array as a whole — expand it using .*/THRU notation.