Informix Error -4094: Length of compared CHAR or VARCHAR types is different.
Cause and resolution
Length of compared CHAR or VARCHAR types is different.
The compiler was attempting to process a comparison between two string types (such as comparing function signatures), and the two strings had different bounds.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4094 fires while the compiler is processing a comparison between two string types (such as comparing function signatures) — per the official guidance, the two strings' declared bounds (lengths) are different.
- Two
CHAR/VARCHARtypes being compiler-compared with different declared lengths, per the official guidance — the direct, only cause.
Solutions / Resolution
- Make the declared lengths of the compared string types match.
Examples
Mismatched string type lengths in a prototype comparison
FUNCTION save(name CHAR(30)) RETURNING INTEGER
...
FUNCTION save(name CHAR(50)) RETURNING INTEGER
-- -4094: CHAR(30) vs CHAR(50)
Corrected
FUNCTION save(name CHAR(30)) RETURNING INTEGER
Diagnostic Checks
- Check the declared lengths of every compared
CHAR/VARCHARtype (e.g. across redeclared function signatures), and make them consistent.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4094 in this set yet.
Two compared CHAR/VARCHAR types have different declared lengths — make them match.