Informix Error -4325: The source and destination records in this record assignment statement are not compatible in types and/or lengths.
Cause and resolution
The source and destination records in this record assignment statement are not compatible in types and/or lengths.
This statement uses asterisk notation to assign all components of one record to the corresponding components of another. However, the components do not correspond. Note that 4GL matches record components strictly by position, the first to the first, second to second, and so on; it does not match them by name. If the source and destination records do not have the same number and type of components, you will have to write a simple assignment statement for each component.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4325 fires when an asterisk-notation record assignment's components don't correspond — per the official guidance, 4GL matches record components strictly by position (first to first, second to second, and so on), never by name; if the number or types of components differ, this fails.
- The source and destination records have a different number of components, per the official guidance — the first named case.
- Corresponding components have incompatible types, per the official guidance — the second named case.
Solutions / Resolution
- Write a simple assignment statement for each component if the records don't have the same number and type of components, per the official guidance.
Examples
Mismatched record structures
DEFINE rec1 RECORD
a INTEGER,
b DATE
END RECORD
DEFINE rec2 RECORD
a INTEGER,
b DATE,
c DECIMAL
END RECORD
LET rec1.* = rec2.*
-- -4325: rec2 has three components, rec1 has two
Corrected
LET rec1.a = rec2.a
LET rec1.b = rec2.b
Diagnostic Checks
- Check that the source and destination records have the same number of components in the same positional order, with compatible types, before using asterisk-notation assignment.
Related Errors / Related Topics
- -4095 — "Records have different number of fields or fields of incompatible types." A closely related error covering the same record-compatibility condition in a multi-field assignment context.
Two records' components don't correspond by position/type for asterisk-notation assignment — assign each component individually instead.