Informix Error -1265: Overflow occurred on a datetime or interval operation.
Cause and resolution
Overflow occurred on a datetime or interval operation.
Both DATETIME and INTERVAL values are stored internally as DECIMAL values. In this statement, an arithmetic operation that uses DATETIME and/or INTERVAL values has caused an arithmetic overflow. This situation should not occur. Check the precision that is specified for an INTERVAL value. If the INTERVAL value that you want to enter is greater than the default number of digits that are allowed for that field, you must explicitly identify the number of significant digits in your definition. If the error recurs, note all circumstances and contact IBM Informix Technical Support.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1265 fires when an arithmetic operation on DATETIME/INTERVAL values overflows — per the
official guidance, both types are stored internally as DECIMAL, and this is a genuine
arithmetic overflow of that internal representation; the official guidance notes this shouldn't
normally occur.
- An
INTERVALvalue's precision not explicitly specified, when the actual value exceeds the default significant-digit limit, per the official guidance's suggested check. - A genuinely unusual arithmetic combination producing an internal
DECIMALoverflow, per the official guidance's "should not normally occur" framing.
Solutions / Resolution
- Check the precision specified for
INTERVALvalues, per the official guidance, ensuring the number of significant digits is explicitly defined if the value exceeds default limits. - If the error persists, contact IBM Informix Technical Support, per the official guidance.
Examples
An INTERVAL without explicit precision
SELECT INTERVAL(999999999) DAY TO DAY FROM orders WHERE order_id = 1;
-- -1265: the value exceeds the default significant-digit limit for DAY
Corrected — explicit precision
SELECT INTERVAL(999999999) DAY(9) TO DAY FROM orders WHERE order_id = 1;
Diagnostic Checks
- Check whether
INTERVALprecision was explicitly specified, and widen it if the value exceeds the default.
Related Errors / Related Topics
- -1266 — "Intervals or Datetimes are incompatible for the operation." A related
DATETIME/INTERVALarithmetic error, about incompatible operand types rather than overflow. - -1267 — "The result of a datetime computation is out of range." A related
DATETIMEarithmetic error, about the result itself being an invalid date/time rather than an internal overflow.
An arithmetic overflow on the internal DECIMAL representation of a DATETIME/INTERVAL
value — check for missing explicit INTERVAL precision first.