Informix Error -1273: Output buffer is NULL or too small to hold the result.
Cause and resolution
Output buffer is NULL or too small to hold the result.
This error is returned when the function is called and the address space for the output buffer is null or smaller than the format-string length. Redefine the size of the address, and execute the function again. (This function might require that you define formatting directives with the DBTIME environment variable.)
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1273 fires when a conversion function's output buffer is either NULL or too small for the
formatted result — per the official guidance, some such functions may require formatting
directives defined via DBTIME.
- A
NULLpointer passed as the output buffer, per the official guidance — the direct, named cause. - A buffer allocated too small relative to the format string's expected output length, per the official guidance — the other direct, named cause.
Solutions / Resolution
- Increase the buffer allocation and retry the operation, per the official guidance.
- Check whether
DBTIMEformatting directives are needed, per the official guidance's parenthetical note, for the specific function being called.
Examples
An undersized output buffer
char out_buf[4];
rc = rfmtdate(date_val, "%m/%d/%Y", out_buf);
-- -1273: out_buf is too small for a formatted date like "01/15/2024"
Corrected
char out_buf[20];
rc = rfmtdate(date_val, "%m/%d/%Y", out_buf);
Diagnostic Checks
- Check the output buffer's pointer and size against the format string's expected output length.
Related Errors / Related Topics
- -1272 — "No input buffer has been specified." A related conversion-function error, about the input side rather than the output buffer.
- -1274 — "No output buffer has been specified." A related, more specific error for a zero-length or null output buffer.
The output buffer is NULL or too small — allocate a larger buffer.