Informix Error -4326: A NULL value may not be applied to substrings.
Cause and resolution
A NULL value may not be applied to substrings.
The value NULL is a whole value that is relevant to complete variables only. You can assign NULL to the name of this variable (omitting the substring notation) to make the entire variable contain the null string. Alternatively, you can assign spaces to a substring to make it blank. The only way to delete a portion of a string is to write an expression that extracts the leading and trailing substrings that are to be retained and concatenates them.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4326 fires when NULL is assigned to a substring of a variable — per the official guidance,
NULL is a whole-variable value; it can be assigned to a variable's plain name (making the
entire variable null), but not to a substring of it.
NULLassigned to a substring reference of a variable, per the official guidance — the direct, only cause.
Solutions / Resolution
- Assign
NULLto the whole variable (omitting the substring notation) if that was intended, per the official guidance. - Assign spaces to a substring to blank it, per the official guidance, as an alternative.
- To delete a portion of a string, concatenate the leading and trailing substrings to be retained, per the official guidance.
Examples
Assigning NULL to a substring
DEFINE name CHAR(30)
LET name[1,10] = NULL
-- -4326: NULL cannot be applied to a substring
Corrected
LET name[1,10] = " "
Diagnostic Checks
- Check every substring assignment for a
NULLvalue, and use spaces or a whole-variable assignment instead.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4326 in this set yet.
NULL is assigned to a substring, which isn't allowed — use spaces to blank it, or assign
NULL to the whole variable instead.