Informix Error -4074: No more than two substring index expressions are allowed.
Cause and resolution
No more than two substring index expressions are allowed.
The substring qualifier consists of a pair of integer expressions, separated by a comma and surrounded by brackets (example: name[1,23]). The first value cannot be larger than the second. Both must be positive and no larger than the string length (or the declared length of the receiving data type).
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4074 fires when a substring qualifier's bracketed index expressions violate the rules — per
the official guidance, the qualifier takes exactly two integer expressions
(name[1,23]-style), the first can't exceed the second, and both must be positive and no
larger than the string's (or the receiving type's) length.
- More than two index expressions in the substring qualifier, per the official guidance — the direct, only cause named in the title.
- The first index larger than the second, or either index non-positive or larger than the string's length, per the official guidance — related bound violations covered by the same description.
Solutions / Resolution
- Use exactly two positive integer expressions, with the first no larger than the second, and neither exceeding the string's (or receiving type's) length.
Examples
Too many substring indices
LET x = name[1,5,10]
-- -4074: only two index expressions are allowed
Corrected
LET x = name[1,5]
Diagnostic Checks
- Check every substring qualifier for exactly two indices, both positive, the first no larger than the second, and neither exceeding the string's length.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -4074 in this set yet.
A substring qualifier violates the two-index/ordering/bounds rules — use exactly two valid indices.