Informix Error -9500: A subscript is out of bounds.
Cause and resolution
A subscript is out of bounds.
This statement takes a substring of a character variable. The substring values (that is, two numbers in square brackets) are incorrect. The first is less than zero or greater than the length of the column, or the second is less than the first. Correct the form specification and recompile.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-9500 fires when a report's form specification takes a substring of a character variable with invalid subscript bounds — per the official guidance.
- A first subscript number less than zero or greater than the column's length, per the official guidance — the first named cause.
- A second subscript number less than the first, per the official guidance — the second named cause.
Solutions / Resolution
- Correct the form specification and recompile, per the official guidance.
Examples
An invalid subscript pair
customer_name[10,5] -- -9500: second number less than the first
Corrected
customer_name[5,10]
Diagnostic Checks
- Check both subscript numbers against the column's length and against each other, and correct the form specification.
Related Errors / Related Topics
- -9001 — "Only columns of type CHARACTER may be subscripted or printed without trailing blanks." A related column-subscripting error, on type rather than bounds.
- -9060 — "The values m and n used to subscript name are outside the bounds for the column's defined length." The same class of subscript-bounds error, raised for ORDER BY substrings specifically.
A form specification's subscript bounds were invalid — correct them and recompile.