Informix Error -1214: Value too large to fit in a SMALLINT.
Cause and resolution
Value too large to fit in a SMALLINT.
The SMALLINT data type can accept numbers with absolute values from 0 through 32,767 (plus or minus (2 to the 15th power) - 1). To store numbers that are outside this range, redefine the column or variable to use INTEGER or DECIMAL type. (The value -32,768 is a 16-bit value but is not acceptable; it indicates a null value in 4GL.)
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1214 fires when a value exceeds what SMALLINT can hold — per the official guidance,
SMALLINT supports absolute values from 0 to 32,767 (±2^15 - 1); notably, -32,768 — although
technically representable in 16 bits — is reserved by 4GL as a null indicator and can't be used
as an actual data value.
- A value greater than 32,767 or less than -32,767 assigned to a
SMALLINT, per the official guidance — the direct, common cause. - A value of exactly
-32,768assigned to aSMALLINT, per the official guidance's specific reserved-value case — technically in range, but reserved as 4GL's null indicator.
Solutions / Resolution
- Use
INTEGERorDECIMALinstead ofSMALLINT, per the official guidance, if the value genuinely needs a wider range. - Avoid assigning exactly
-32,768to aSMALLINT, per the official guidance's specific reserved-value note, even though it's technically within the 16-bit range.
Examples
A value beyond SMALLINT's range
DEFINE v_count SMALLINT;
LET v_count = 40000;
-- -1214: 40000 exceeds SMALLINT's 32,767 maximum
Corrected — widen the type
DEFINE v_count INTEGER;
LET v_count = 40000;
Diagnostic Checks
- Check the actual value against
SMALLINT's effective range (±32,767, with-32,768specifically excluded as 4GL's null indicator).
Related Errors / Related Topics
No closely related error codes are cross-referenced for -1214 in this set yet.
The value exceeds SMALLINT's effective range (or is exactly -32,768, reserved as 4GL's null
indicator) — use INTEGER or DECIMAL instead.