Informix Error -4509: An array variable has been referenced outside of its specified dimensions.
Cause and resolution
An array variable has been referenced outside of its specified dimensions.
An array bound has been exceeded, and array-bounds checking has been turned on. Array-bounds checking can be turned on through the compiler switch "-a" or the PRAGMA ARRAY BOUNDS statement. Only NewEra returns this error.
-4509 An array variable has been referenced outside of its specified dimensions.
See error -1326, which has replaced this error for products other than NewEra.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4509 covers two variants, per the official guidance. On NewEra, this code stays active with
its own meaning: an array bound has been exceeded while array-bounds checking is turned on
(via the -a compiler switch or a PRAGMA ARRAY BOUNDS statement). On products other than
NewEra, this code is a legacy wording that has been replaced by error -1326.
- On NewEra: an array bound was exceeded with bounds-checking enabled, per the official guidance — the direct, active cause on that product.
- On other products: this exact wording is superseded, per the official guidance — -1326 now covers the same underlying condition there.
Solutions / Resolution
- On NewEra, correct the array subscript so it stays within the declared dimensions, per the official guidance.
- On other products, treat this as -1326 and apply that code's resolution steps.
Examples
An out-of-bounds array reference (NewEra, bounds-checking enabled)
DEFINE items ARRAY[10] OF INTEGER
LET items[11] = 5
-- -4509: subscript 11 exceeds the declared dimension of 10
Diagnostic Checks
- On NewEra, check every array subscript against its declared dimensions, especially
with
-aorPRAGMA ARRAY BOUNDSenabled. - On other products, confirm whether -1326 is the code actually reported, and refer to that code's diagnostics.
Related Errors / Related Topics
- -1326 — "An array variable has been referenced outside of its specified dimensions." The current, active code that has replaced -4509 for products other than NewEra.
An array bound was exceeded with bounds-checking enabled (NewEra), or this legacy wording has been replaced by -1326 on other products.