Informix Error -693: System command expects a non-null value.
Cause and resolution
System command expects a non-null value.
A null value was passed to the SYSTEM statement.
Example of error:
DEFINE c CHAR(100); LET c = NULL; ... SYSTEM c; -- error
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-693 fires when a SYSTEM statement's command argument evaluates to NULL — per the official
guidance's example, a variable set to NULL passed to SYSTEM triggers this error.
- A variable used as the
SYSTEMcommand that was never assigned a value, per the official guidance's example — leaving it NULL by default. - A variable that legitimately became NULL (for example, from a failed lookup or an outer
join) used as the
SYSTEMcommand without a NULL check first.
Solutions / Resolution
- Confirm the variable used as the
SYSTEMcommand has actually been assigned a value before theSYSTEMstatement runs. - Add a NULL check before the
SYSTEMstatement, if the command string is built from a value that could legitimately come back NULL:IF v_command IS NOT NULL THEN SYSTEM v_command; END IF;
Examples
The disallowed attempt
DEFINE v_command VARCHAR(200);
-- v_command was never assigned a value; it's NULL
SYSTEM v_command;
-- -693: v_command is NULL
Corrected
DEFINE v_command VARCHAR(200);
LET v_command = 'echo hello';
SYSTEM v_command;
Diagnostic Checks
- Trace the value assigned to the
SYSTEMstatement's command argument back to its source, confirming it's guaranteed non-NULL by the time theSYSTEMstatement executes.
Related Errors / Related Topics
- -668 — "The system command cannot be executed or it exited with a non-zero status." A
related
SYSTEMstatement error, about the command's execution/exit status rather than a NULL argument.
Confirm the variable used as the SYSTEM command has actually been assigned a non-NULL value
before the statement runs.