Informix Error -477
-477 Buffer is too small.
In a GET DESCRIPTOR statement, the buffer (the character host variable) that is specified to store the NAME entry is too small. Increase the buffer size, and call the GET DESCRIPTOR statement again. This error message also is displayed when the host variable is a FILE type, and the buffer used to store its name is too small.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-477 fires in a GET DESCRIPTOR statement when the character host variable designated to
receive a NAME entry (a column or item name) is too small to hold it — a similar underlying
class of problem as -451's locator buffer sizing, but here specifically for descriptor name
retrieval.
- A fixed-size host variable for
NAMEthat's smaller than the actual column/item name being retrieved — long identifiers can exceed a conservatively-sized buffer. - A
FILE-type host variable whose name buffer lacks adequate capacity for the actual filename being stored — a related but distinct scenario per the official guidance. - Code written assuming short identifier names, later encountering longer names (e.g. from a schema using longer, more descriptive column names than originally anticipated).
Solutions / Resolution
- Increase the buffer size and re-execute the
GET DESCRIPTORstatement, per the official guidance. - Size the buffer generously relative to the maximum possible identifier length for the
server version in use (identifier length limits vary — see
-354), rather than a short, optimistic size. - For the
FILE-type variant, ensure its name buffer is sized adequately for the actual filenames expected.
Examples
Sizing a NAME buffer generously
char col_name[129]; /* generous relative to the server's max
identifier length, rather than a short,
optimistic size */
EXEC SQL GET DESCRIPTOR 'desc1' VALUE 1 :col_name = NAME;
Diagnostic Checks
- Check the actual length of the column/item name being retrieved against the host variable's declared size.
- Confirm whether a
FILE-type variable's name buffer is involved, and check its capacity too.
Related Errors / Related Topics
- -451 — "Locator buffer size too small." A conceptually similar buffer-sizing error, in the
blob-locator context rather than descriptor
NAMEretrieval. - -474 — "Unknown field type." Another related
GET DESCRIPTOR-field restriction, about valid field type keywords rather than buffer sizing.
Size NAME-receiving buffers generously relative to the server's maximum identifier length,
rather than a short, optimistic size that might work for most but not all names.