Informix Error -4433: A variable used in the above statement must be of type CHAR or VARCHAR.
Cause and resolution
A variable used in the above statement must be of type CHAR or VARCHAR.
The filename in the REPORT TO statement must be given as a character value; and the program name in the REPORT TO PIPE statement must also be given as a character value. In either case, this can be a constant, a variable of either of the types mentioned, or an expression. However, it cannot be a number or other data type; no automatic type conversion occurs in these statements.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4433 fires when REPORT TO's filename (or REPORT TO PIPE's program name) isn't a character
value — per the official guidance, a constant, CHAR/VARCHAR variable, or expression is
acceptable, but no automatic type conversion occurs.
REPORT TO/REPORT TO PIPE's value isn'tCHAR/VARCHAR, per the official guidance — the direct, only cause.
Solutions / Resolution
- Use a
CHAR/VARCHARconstant, variable, or expression, per the official guidance, converting a non-character value first if needed.
Examples
A non-character REPORT TO value
DEFINE report_num INTEGER
REPORT TO report_num
-- -4433: report_num is INTEGER, not CHAR/VARCHAR
Corrected
DEFINE report_name CHAR(30)
LET report_name = "orders_", report_num USING "&&&&&"
REPORT TO report_name
Diagnostic Checks
- Check the type of every
REPORT TO/REPORT TO PIPEvalue, and confirm it'sCHAR/VARCHAR.
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
REPORT TOspecifically.
REPORT TO/REPORT TO PIPE's value isn't CHAR/VARCHAR — convert it first.