Informix Error -4402: In this type of statement, subscripting may be applied only to array variables to select individual array elements.
Cause and resolution
In this type of statement, subscripting may be applied only to array variables to select individual array elements.
The statement contains a name followed by square brackets, but the name is not that of an array variable. Check the punctuation of the statement and the spelling of all names. Names that are subscripted must be arrays. If you intended to use a character substring in this statement, you will have to revise the program.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4402 fires when a name followed by square brackets isn't an array variable, in a statement context where only array subscripting (not substring notation) is valid — per the official guidance, check the punctuation and spelling; if a character substring was intended, the program will need revising.
- A non-array name subscripted in a context that only supports array subscripting, per the official guidance — the direct, only cause.
Solutions / Resolution
- Check the punctuation of the statement and the spelling of all names, per the official guidance.
- If a character substring was intended, revise the program, per the official guidance, since this statement type doesn't support substring notation.
Examples
Subscripting a non-array name
DEFINE qty INTEGER
LET x = qty[1]
-- -4402: qty is not an array variable
Corrected
DEFINE items ARRAY[10] OF INTEGER
LET x = items[1]
Diagnostic Checks
- Check the declaration of the subscripted name, and confirm it's genuinely an array variable.
Related Errors / Related Topics
- -4159 — "Subscripting cannot be applied to the expression because it is not a character or array reference." A related subscripting error, about a broader statement context that also accepts substring notation.
- -4344 — "The variable variable-name cannot be used with substrings because it is not a character variable." A related error covering the substring side of this same general restriction.
A non-array name is subscripted in a context that only supports array subscripting — check its declaration.