Informix Error -4324: The variable variable-name is not a character type, and cannot be used to contain the result of concatenation.
Cause and resolution
The variable variable-name is not a character type, and cannot be used to contain the result of concatenation.
This statement attempts to concatenate two or more character strings (using the comma as the concatenation operator) and assign the result to the named variable. Unfortunately, it is not a character variable. 4GL will not perform automatic conversion from characters in this case. Assign the concatenated string to a character variable; then, if you want to treat the result as numeric, assign the string as a whole to a numeric variable.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4324 fires when a concatenation's result (using the comma concatenation operator) is assigned to a non-character variable — per the official guidance, 4GL won't automatically convert from character to another type in this case.
- A concatenated string assigned to a non-character variable, per the official guidance — the direct, only cause.
Solutions / Resolution
- Assign the concatenated string to a character variable, per the official guidance.
- If a numeric result is needed, then assign the resulting string as a whole to a numeric variable, per the official guidance.
Examples
Concatenating into a non-character variable
DEFINE total INTEGER
LET total = "12", "34"
-- -4324: total is INTEGER, not a character type
Corrected
DEFINE combined CHAR(10)
DEFINE total INTEGER
LET combined = "12", "34"
LET total = combined
Diagnostic Checks
- Check the type of every concatenation-result assignment target, and use an intermediate character variable if the final target is non-character.
Related Errors / Related Topics
- -4075 — "Simple string expressions must have type CHAR or VARCHAR." A related string-type requirement, about simple string expressions generally rather than concatenation-result assignment specifically.
A concatenation's result is assigned to a non-character variable — use an intermediate character variable first.