Informix Error -4395: There are too many subscripts specified with a database column name.
Cause and resolution
There are too many subscripts specified with a database column name.
In this statement the name of a database column is followed by square brackets with several numbers between them. The only valid use for square brackets with a database column is to select a substring from a character column. However, for that use you must write exactly two numbers, the subscripts of the first and last letters of the substring. Here more than two numbers are used. Check and correct the punctuation.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4395 fires when a database column name is followed by more than two numbers in square brackets — per the official guidance, the only valid use of brackets on a column is to select a substring from a character column, which requires exactly two numbers (the first and last letter positions).
- A database column reference followed by more than two bracketed numbers, per the official guidance — the direct, only cause.
Solutions / Resolution
- Check and correct the punctuation, per the official guidance, using exactly two numbers for a substring selection.
Examples
Too many subscripts on a column reference
SELECT description[1,5,10] FROM items;
-- -4395: three numbers exceeds the two allowed for a substring
Corrected
SELECT description[1,5] FROM items;
Diagnostic Checks
- Check every bracketed database-column reference, and confirm it uses exactly two numbers.
Related Errors / Related Topics
- -4074 — "No more than two substring index expressions are allowed." A closely related error covering the same two-index restriction in the general substring-expression context.
A database column reference has more than two bracketed numbers — use exactly two for a valid substring selection.