Informix Error -4075: Simple string expressions must have type CHAR or VARCHAR.
Cause and resolution
Simple string expressions must have type CHAR or VARCHAR.
The compiler expected a string expression but found an expression that was neither CHAR nor VARCHAR data type.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4075 fires when the compiler expects a simple string expression but finds one of a different
data type — per the official guidance, only CHAR and VARCHAR qualify as simple string
expressions in this context.
- A non-
CHAR/VARCHARexpression used where a simple string expression is required, per the official guidance — the direct, only cause.
Solutions / Resolution
- Use a
CHARorVARCHARexpression, converting the value first if needed.
Examples
A non-string expression where a string is required
DEFINE qty INTEGER
LET x = qty[1,2]
-- -4075: qty is INTEGER, not CHAR/VARCHAR
Corrected
LET x = qty USING "&&"
Diagnostic Checks
- Check the data type of every expression used where a simple string is required, and
convert it to
CHAR/VARCHARif it isn't already.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4075 in this set yet.
A non-CHAR/VARCHAR expression is used where a simple string expression is required —
convert it first.