Informix Error -649: The debug file name must be a NON-NULL CHAR or VARCHAR.
Cause and resolution
The debug file name must be a NON-NULL CHAR or VARCHAR.
The argument that is specified for the debug file in the SET DEBUG statement must be a character data type.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-649 fires when SET DEBUG FILE TO's argument isn't a non-NULL character type — per the official
guidance, the argument must be CHAR/VARCHAR.
- A NULL value passed as the debug file name, per the official guidance — the argument must be non-NULL.
- A non-character-typed value or variable passed, per the official guidance — a numeric or
other non-
CHAR/VARCHARtype given where a file name string is expected.
Solutions / Resolution
- Supply a non-NULL
CHAR/VARCHARvalue for the debug file name, per the official guidance. - Check any variable used for the debug file name is both character-typed and confirmed
non-NULL before the
SET DEBUG FILE TOstatement runs.
Examples
A NULL debug file name
DEFINE v_debug_path VARCHAR(200);
-- v_debug_path was never assigned a value; it's NULL
SET DEBUG FILE TO v_debug_path;
-- -649: v_debug_path is NULL
Corrected
DEFINE v_debug_path VARCHAR(200);
LET v_debug_path = '/path/to/debug/directory/routine_trace.out';
SET DEBUG FILE TO v_debug_path;
Diagnostic Checks
- Confirm the value/variable supplied is
CHAR/VARCHARtyped and has actually been assigned a non-NULL value before theSET DEBUG FILE TOstatement executes.
Related Errors / Related Topics
- -648 — "Cannot open DEBUG file for SPL routine trace." A related
SET DEBUGerror, about the path's validity/permissions once a valid non-NULL character value has been supplied.
A type/nullability check on the argument itself — confirm it's a non-NULL CHAR/VARCHAR
before troubleshooting the path further (that's -648's territory).