Informix Error -1346: Number is too large for a DECIMAL data type.
Cause and resolution
Number is too large for a DECIMAL data type.
The DECIMAL data type accommodates numbers from 10 to the -130th power through 10 to the 124th power in absolute value. The precision (number of significant digits) varies from 1 to 32; however, the source of this error is not the length of the number but its magnitude.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1346 fires when a number's magnitude exceeds what DECIMAL can represent under 4GL — per the
official guidance, DECIMAL accommodates absolute values from 10^-130 through 10^124, with
1 to 32 significant digits of precision; this error is specifically about the value's magnitude
being too large, not its digit count. Note this documented upper bound (10^124) differs
slightly from -1200's documented SQL-engine bound (1.000E+126) — the two pages may reflect
different product contexts (4GL vs. the SQL engine directly) or documentation drift; verify
against the current server/4GL version's own documentation if the exact boundary matters.
- A computed or literal value with an absolute magnitude greater than
10^124, per the official guidance — the direct, only cause. - An arithmetic operation that overflows
DECIMAL's upper bound, even though each individual operand was within range.
Solutions / Resolution
- Review the computation or literal producing the oversized value, per the official guidance, and confirm it's actually the intended magnitude.
- If the value is genuinely correct, reconsider whether
DECIMALis the right data type for values at this scale.
Examples
An overflowing computation
DEFINE v_result DECIMAL(32);
LET v_result = 1e100 * 1e50;
-- -1346: the product's magnitude exceeds DECIMAL's documented upper bound
Diagnostic Checks
- Check the actual magnitude of the value involved against
DECIMAL's documented upper bound for the version/product context in use.
Related Errors / Related Topics
- -1200 — "Number is too large for a DECIMAL data type." The same-named SQL-engine error,
whose documented upper bound (
1.000E+126) differs slightly from -1346's 4GL-documented bound (10^124) — worth reconciling against current documentation if the exact boundary matters. - -1347 — "Number is too small for a DECIMAL data type." The mirror-image restriction, for
magnitude below
DECIMAL's minimum rather than above its maximum.
A value's magnitude exceeded DECIMAL's documented upper bound — review the computation or
literal that produced it.