Informix Error -22555: The type of host-variable does not match the expected type for this field.
Cause and resolution
The type of host-variable does not match the expected type for this field.
This error is generated when a variable is expected to have a certain type but does not. For example, an TYPE field accepts only integer types when a value is assigned to it or retrieved from it. If the variable type is not integer, an error is generated. Check the syntax and usage for system descriptor field names in the discussion of the ALLOCATE DESCRIPTOR and GET DESCRIPTOR statements in the IBM Informix Guide to SQL: Syntax. For a discussion of the system descriptor area, see the manual for your embedded-language product.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-22555 fires when a host variable's type doesn't match a system-descriptor field's
expected type — per the official guidance, for example a TYPE field accepts only
integer types, and assigning/retrieving a non-integer value triggers this.
- A host variable's type mismatching the system-descriptor field's expected type, per the official guidance — the direct, only cause.
Solutions / Resolution
- Check the syntax and usage for system-descriptor field names in the
ALLOCATE DESCRIPTOR/GET DESCRIPTORdiscussion of the IBM Informix Guide to SQL: Syntax, per the official guidance, and consult your embedded-language manual for the system-descriptor area.
Examples
N/A
No specific triggering statement is documented beyond a mismatched host-variable type.
Diagnostic Checks
- Check the flagged field's expected type against the host variable's actual type, and correct the mismatch.
Related Errors / Related Topics
- -22554 — "Field type field-type-name has been used out of context." A related system-descriptor error, on a field type used in the wrong context rather than a host variable's type mismatching a field.
A host variable's type didn't match a system-descriptor field's expected type — check the field-name syntax reference.