Informix Error -472
-472 Occurrence value is out of range.
Change the value of the COUNT statement so that it is less than or equal to the occurrences and greater than zero, and try again.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-472 fires when a GET DESCRIPTOR/SET DESCRIPTOR (or similar) statement's VALUE (occurrence
number) argument falls outside the valid range for the descriptor — it must be greater than zero
and no larger than the number of occurrences the descriptor was actually allocated to hold (via
ALLOCATE DESCRIPTOR ... WITH MAX).
- A
VALUEargument larger than the descriptor's allocated occurrence count — attempting to access an item slot beyond what was allocated. - A
VALUEargument of zero or negative — occurrence numbers are 1-based, so these are never valid. - A loop iterating over descriptor items using the wrong upper bound, off by one or based on a stale/incorrect count.
Solutions / Resolution
- Adjust the
VALUEto be greater than zero and less than or equal to the available occurrences, per the official guidance, then retry the operation. - Check the descriptor's actual allocated occurrence count (via
GET DESCRIPTOR ... COUNT) before looping over its items, rather than assuming a fixed or previously-cached count. - Review loop bounds iterating over descriptor items for off-by-one mistakes.
Examples
Checking COUNT before iterating
GET DESCRIPTOR 'desc1' :num_items = COUNT;
-- iterate from 1 to num_items, not an assumed fixed value
An out-of-range VALUE
GET DESCRIPTOR 'desc1' VALUE 15 :col_name = NAME;
-- -472 if desc1 was only allocated for (or actually holds) fewer
-- than 15 occurrences
Diagnostic Checks
- Check the descriptor's actual occurrence count via
GET DESCRIPTOR ... COUNT. - Compare the
VALUEargument being used against that count. - Review loop bounds for off-by-one errors when iterating over descriptor items.
Related Errors / Related Topics
- -470 — "The value of occurrence must be greater than 0." A related occurrence-value restriction, at allocation time rather than at access time.
- -469 — "This descriptor does not exist." A related descriptor-usage error, about a missing allocation rather than an out-of-range access on an existing one.
Always check the descriptor's actual COUNT before accessing a specific occurrence — don't
assume a fixed or previously-cached occurrence count still applies.