Informix Error -4327
-4327 The variable variable-name is not of type INTEGER or SMALLINT. It
cannot be used as a loop index.The index variable in a FOR loop must be an integer type. Specify a different variable, or redefine the one named.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4327 fires when a FOR loop's index variable isn't INTEGER or SMALLINT — per the official
guidance, the index variable in a FOR loop must be an integer type.
- A
FORloop's index variable declared as a non-integer type, per the official guidance — the direct, only cause.
Solutions / Resolution
- Specify a different variable, or redefine the one named, per the official guidance, as
INTEGERorSMALLINT.
Examples
A DECIMAL loop index
DEFINE ix DECIMAL(5,0)
FOR ix = 1 TO 10
...
END FOR
-- -4327: ix must be INTEGER or SMALLINT
Corrected
DEFINE ix INTEGER
FOR ix = 1 TO 10
...
END FOR
Diagnostic Checks
- Check the declared type of every
FORloop's index variable, and confirm it'sINTEGERorSMALLINT.
Related Errors / Related Topics
- -4331 — "Only variables of type INTEGER or SMALLINT may be used to index display
fields." A related integer-type requirement, about screen-array subscripts rather than
FORloop indices.
A FOR loop's index variable isn't INTEGER/SMALLINT — redeclare it as one of those types.