Informix Error -4364: Type of initialization/default expression does not match declared type of the variable/parameter.
Cause and resolution
Type of initialization/default expression does not match declared type of the variable/parameter.
The initialization expression for the specified variable does not evaluate to a data type that is compatible with the declared type. Review the expression, and make it and the declared type agree.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4364 fires when a variable or parameter's initialization/default expression doesn't evaluate to a type compatible with its declared type — per the official guidance, this is a direct type mismatch.
- An initialization/default expression whose type is incompatible with the variable's declared type, per the official guidance — the direct, only cause.
Solutions / Resolution
- Review the expression, and make it agree with the declared type, per the official guidance.
Examples
A type-mismatched default value
DEFINE status CHAR(10) = 0
-- -4364: 0 is INTEGER, status is CHAR(10)
Corrected
DEFINE status CHAR(10) = "New"
Diagnostic Checks
- Check every variable/parameter's initialization or default expression against its declared type, and correct any mismatch.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4364 in this set yet.
An initialization/default expression's type doesn't match the declared type — make them agree.