Informix Error -479
-479 The number of DESCRIBED columns is greater than the allocated space.
The number of columns in the table is larger than the allocated descriptor. Use the ALLOCATE DESCRIPTOR statement to reallocate a larger occurrence value, and try the DESCRIBE statement again.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-479 fires when DESCRIBE is executed against a descriptor that wasn't allocated enough
occurrence slots to hold every column the target statement/table actually returns — the
descriptor's WITH MAX occurrence count (see -470) is too small.
- A descriptor allocated with a fixed, hardcoded occurrence count that's smaller than the actual number of columns in the query being described.
- A query that grew over time (columns added), while the descriptor allocation size wasn't correspondingly increased.
- Generic/dynamic SQL tooling assuming a small, fixed maximum column count that doesn't hold for every possible query it might need to describe.
Solutions / Resolution
- Use
ALLOCATE DESCRIPTORto increase the occurrence value, per the official guidance, then retry theDESCRIBEstatement. - For dynamic/generic tooling, allocate the descriptor generously or determine the required size dynamically before allocating, rather than assuming a small fixed maximum.
- If the query grew over time, review the descriptor allocation size alongside any schema/ query changes that add columns.
Examples
Increasing the allocated occurrence count
ALLOCATE DESCRIPTOR 'desc1' WITH MAX 50;
PREPARE stmt1 FROM 'SELECT * FROM wide_table';
DESCRIBE stmt1 USING SQL DESCRIPTOR 'desc1';
The disallowed insufficient allocation
ALLOCATE DESCRIPTOR 'desc1' WITH MAX 5;
PREPARE stmt1 FROM 'SELECT * FROM wide_table'; -- has 20 columns
DESCRIBE stmt1 USING SQL DESCRIPTOR 'desc1';
-- -479: wide_table has more columns than desc1 can hold
Diagnostic Checks
- Compare the descriptor's allocated occurrence count against the actual number of columns in the statement being described.
- Check for a recent schema/query change that added columns, if a previously-working
DESCRIBEstarted failing.
Related Errors / Related Topics
- -470 — "The value of occurrence must be greater than 0." A related occurrence-value restriction, about the value being positive rather than sufficiently large.
- -472 — "Occurrence value is out of range." A related occurrence-indexing error, at access
time rather than at
DESCRIBEtime.
Allocate the descriptor generously, or determine the actual column count dynamically before allocating, rather than assuming a small fixed maximum will always be sufficient.