Informix Error -607
-607 Text/Byte subscript error.
This statement refers to a TEXT or BYTE value that uses substring notation (numbers in square brackets that follow the name). However, the substring is not correctly written. Review all uses of substrings, and make sure that the first number in each is greater than zero but not greater than the length of the value; the second number is not less than the first; and the numbers are separated by a comma.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-607 fires when TEXT/BYTE substring notation (column[start,end]) is malformed — per the
official guidance, three specific rules govern valid subscripts, and this error means one of them
was broken.
- The first subscript number is zero, negative, or greater than the value's length — per the official guidance, it must be greater than zero but not greater than the length of the value.
- The second subscript number is less than the first, per the official guidance — the range must run forward, not backward.
- The two numbers aren't separated by a comma, per the official guidance — a different separator (or none) breaks the subscript syntax outright.
Solutions / Resolution
- Review the subscript against all three rules, per the official guidance: first number greater than zero and no greater than the value's length; second number not less than the first; comma-separated.
- Check the actual length of the
TEXT/BYTEvalue if the first number's validity is in question, since the upper bound depends on the specific value's length, not a fixed constant. - Correct the subscript syntax once the specific violated rule is identified.
Examples
An invalid first number
SELECT content[0,10] FROM documents WHERE doc_id = 1;
-- -607: the first subscript must be greater than zero
A backward range
SELECT content[10,5] FROM documents WHERE doc_id = 1;
-- -607: the second number is less than the first
Corrected
SELECT content[1,10] FROM documents WHERE doc_id = 1;
Diagnostic Checks
- Check each of the three subscript rules individually against the failing statement: the first number's range, the second number's relation to the first, and the comma separator.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -607 in this set yet.
Three specific rules govern TEXT/BYTE subscripts — check each one individually against the
failing expression.