Informix Error -1284: Value will not fit in a BIGINT or an INT8.
Cause and resolution
Value will not fit in a BIGINT or an INT8.
The BIGINT or BIGSERIAL or INT8 or SERIAL8 data type can accept numbers with absolute values from 0 through 9,223,372,036,854,775,807 (plus or minus (2 to the 63rd power) - 1).
To store numbers that are outside this range, redefine the column or variable to use the DECIMAL data type. For more information on valid ranges of data types, see the IBM Informix Guide to SQL: Reference.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1284 fires when a value exceeds what BIGINT/BIGSERIAL/INT8/SERIAL8 can hold — per the
official guidance, these types support values from 0 to 9,223,372,036,854,775,807 in absolute
value.
- A value greater than 9,223,372,036,854,775,807 (or less than its negative) assigned to a
BIGINT/INT8, per the official guidance — the direct, only cause. - A
BIGSERIAL/SERIAL8column that has exhausted its 64-bit range, in an extremely long-running or high-volume table.
Solutions / Resolution
- Redefine the column or variable using
DECIMALinstead, per the official guidance —DECIMALaccommodates larger numbers than any integer type.
Examples
A value beyond BIGINT's range
DEFINE v_total BIGINT;
LET v_total = 99999999999999999999;
-- -1284: exceeds BIGINT's 9,223,372,036,854,775,807 maximum
Corrected — widen the type
DEFINE v_total DECIMAL(25);
LET v_total = 99999999999999999999;
Diagnostic Checks
- Check the actual value against
BIGINT/INT8's ±9,223,372,036,854,775,807 range.
Related Errors / Related Topics
- -1214 — "Value too large to fit in a SMALLINT." A related type-range error, for the narrowest integer type.
- -1215 — "Value too large to fit in an INTEGER." A related type-range error, for the next narrower integer type.
The value exceeds BIGINT/INT8's ±9,223,372,036,854,775,807 range — use DECIMAL instead.