Informix Error -16393: Expression or variable contains invalid substring.
Cause and resolution
Expression or variable contains invalid substring.
The Debugger cannot interpret a reference to a substring of a character value. Two numbers in square brackets specify a substring, as in the following expression:
charvalue[n1,n2]
The name charvalue must be the CHAR(n) data type; n1 specifies the first character of the substring, and n2 specifies the last. This error message appears when n1 is larger than n, the length of the character value, or when n1 is greater than n2.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-16393 fires when a charvalue[n1,n2] substring reference is invalid — per the official
guidance. charvalue must be CHAR(n); n1 is the first character position, n2 the
last.
n1greater thann, the length of the character value, per the official guidance — the first named case.n1greater thann2, per the official guidance — the second named case.
Solutions / Resolution
- Correct
n1/n2son1is at mostnand at mostn2, per the official guidance.
Examples
An out-of-range substring reference
> PRINT myname[10,3]
Corrected
> PRINT myname[3,10]
Diagnostic Checks
- Check
n1/n2against the character value's actual length, and correct the ordering/bounds.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -16393 in this set yet.
A substring reference's bounds are invalid — check n1 against the value's length and
against n2.