Informix Error -1821: Host variable is not large enough to hold the data returned from the server.
Cause and resolution
Host variable is not large enough to hold the data returned from the server.
The memory allocated by the application to fetch the user-defined data type is not sufficient. Change the application so that it allocates more memory before it fetches this user-defined data type.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1821 fires when the application's allocated memory for a user-defined-data-type host variable is too small for the value actually fetched — per the official guidance, this is an allocation- size shortfall specific to UDTs.
- Insufficient memory allocated for the host variable relative to the actual UDT value's size, per the official guidance — the direct, only cause.
Solutions / Resolution
- Modify the application to allocate additional memory before retrieving this user-defined data type, per the official guidance.
Examples
N/A
No specific triggering statement is documented — increase the allocated size for the UDT host variable before fetching.
Diagnostic Checks
- Check the allocated size of the host variable against the actual size of the UDT value being fetched.
Related Errors / Related Topics
- -1207 — "Converted value does not fit into the allotted space." A related buffer-sizing error, about a converted non-character value in general rather than a UDT specifically.
- -1820 — "The host variable type was changed between fetches or puts." A related UDT host-variable error, about a mid-sequence type change rather than insufficient size.
The UDT host variable's allocated memory is too small — allocate more before fetching.