Informix Error -1347: Number is too small for a DECIMAL data type.
Cause and resolution
Number is too small 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
-1347 is the mirror image of -1346: it fires when a number's magnitude falls below what
DECIMAL can represent under 4GL — per the official guidance, DECIMAL accommodates absolute
values from 10^-130 through 10^124; this error is specifically about the value's magnitude
being too small (too close to zero), not its digit count.
- A computed or literal nonzero value with an absolute magnitude smaller than
10^-130, per the official guidance — the direct, only cause. - An arithmetic operation that underflows
DECIMAL's lower bound, even though each individual operand was within range.
Solutions / Resolution
- Review the computation or literal producing the undersized 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 underflowing computation
DEFINE v_result DECIMAL(32);
LET v_result = 1e-100 / 1e50;
-- -1347: the quotient's magnitude falls below DECIMAL's documented lower bound
Diagnostic Checks
- Check the actual magnitude of the value involved against
DECIMAL's documented lower bound for the version/product context in use.
Related Errors / Related Topics
- -1201 — "Number is too small for a DECIMAL data type." The same-named SQL-engine error,
sharing the
10^-130lower bound with -1347's 4GL-documented one. - -1346 — "Number is too large for a DECIMAL data type." The mirror-image restriction, for
magnitude above
DECIMAL's maximum rather than below its minimum.
A nonzero value's magnitude fell below DECIMAL's 10^-130 floor — review the computation or
literal that produced it.