Informix Error -4095: Records have different number of fields or fields of incompatible types.
Cause and resolution
Records have different number of fields or fields of incompatible types.
In this multiple-field assignment the values that are being assigned do not correctly match to the fields in the receiving record or object. Examine the syntax of the value expression; then review the declaration of the receiving variable.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4095 fires during a multiple-field assignment when the values being assigned don't correctly match the fields of the receiving record or object — per the official guidance, this can be a count mismatch or a type incompatibility per field.
- A different number of values than fields in the receiving record/object, per the official guidance — the first named case.
- A field-by-field type incompatibility, per the official guidance — the second named case.
Solutions / Resolution
- Examine the syntax of the value expression, per the official guidance.
- Review the declaration of the receiving variable, per the official guidance.
Examples
A field-count mismatch in a multi-field assignment
DEFINE rec RECORD
order_id INTEGER,
order_date DATE
END RECORD
LET rec.* = 1001, TODAY, "extra"
-- -4095: three values for a two-field record
Corrected
LET rec.* = 1001, TODAY
Diagnostic Checks
- Check the number and types of values assigned against the receiving record's field list.
Related Errors / Related Topics
- -4093 — "Type mismatch between RECORD and non-RECORD type." A related record-typing error, about pairing a record with a non-record type rather than a field-count/type mismatch within a multi-field assignment.
A multi-field assignment's values don't match the receiving record's field count or types — check both against the record's declaration.