Informix Error -11105: Interval field overflow
Cause and resolution
Interval field overflow
This Informix ODBC error code is the same as SQLSTATE value 22015. The following functions can return this error code: SQLBulkOperations, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch, SQLFetchScroll, SQLGetData, SQLPutData, and SQLSetPos.
For SQLBulkOperations, the Operation argument was SQL_ADD or SQL_UPDATE_BY_BOOKMARK, and the assignment of a date or timestamp value to a column in the result set caused the year, month, or day field to be out of range.
For SQLExecute and SQLExecDirect, StatementText contained an exact numeric or interval parameter that when converted to an interval SQL data type caused a loss of significant digits. *StatementText contained an interval parameter with more than one field that when converted to a numeric data type in a column had no representation in the numeric data type. StatementText contained parameter data that was assigned to an interval SQL type, and there was no representation of the value of the C type in the interval SQL type. Assigning an input/output or output parameter that was an exact numeric or interval SQL type to an interval C type caused a loss of significant digits. When an input/output or output parameter was assigned to an interval C structure, there was no representation of the data in the interval data structure.
SQLExtendedFetch, SQLFetch, SQLGetData, and SQLFetchScroll, assigning from an exact numeric or interval SQL type to an interval C type caused a loss of significant digits in the leading field. When data was fetched to an interval C type, there was no representation of the value of the SQL type in the interval C type.
For SQLPutData, the data sent for an exact numeric or interval column or parameter to an interval SQL data type caused a loss of significant digits. Data was sent for an interval column or parameter with more than one field, was converted to a numeric data type, and had no representation in the numeric data type. The data sent for column or parameter data was assigned to an interval SQL type, and there was no representation of the value of the C type in the interval SQL type. The data sent for an exact numeric or interval C column or parameter to an interval C type caused a loss of significant digits. The data sent for column or parameter data was assigned to an interval C structure, and there was no representation of the data in the interval data structure.
For SQLSetPos, the Operation argument was SQL_UPDATE, and the assignment of an exact numeric or interval C type to an interval SQL data type caused a loss of significant digits. The Operation argument was SQL_UPDATE; when a value was assigned to an interval SQL type, there was no representation of the value of the C type in the interval SQL type. The Operation argument was SQL_REFRESH, and assigning from an exact numeric or interval SQL type to an interval C type caused a loss of significant digits in the leading field. The Operation argument was SQL_REFRESH; when a value was assigned to an interval C type, there was no representation of the value of the SQL type in the interval C type.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-11105 fires when an interval or datetime field value overflows its valid range — per the
official guidance, this is the same as SQLSTATE value 22015, returnable by
SQLBulkOperations, SQLExecDirect, SQLExecute, SQLExtendedFetch, SQLFetch,
SQLFetchScroll, SQLGetData, SQLPutData, and SQLSetPos.
- For
SQLBulkOperationswithOperation=SQL_ADDorSQL_UPDATE_BY_BOOKMARK: assigning a date/timestamp value whose year, month, or day field is out of range, per the official guidance — the first named case. - For
SQLExecute/SQLExecDirect: an exact-numeric or interval parameter that loses significant digits converting to an interval SQL type; an interval parameter with more than one field that has no representation once converted to a numeric column type; or an assignment (C-to-SQL or SQL-to-C) with no representation in the target interval type, per the official guidance — the second named case. - For
SQLExtendedFetch/SQLFetch/SQLGetData/SQLFetchScroll: assigning from an exact-numeric or interval SQL type to an interval C type lost significant digits in the leading field, or the fetched value has no representation in the target interval C type, per the official guidance — the third named case. - For
SQLPutData: sending data to (or from) an interval column/parameter caused a loss of significant digits, had no representation once converted to/from a numeric type, or had no representation in the target interval SQL/C type, per the official guidance — the fourth named case. - For
SQLSetPoswithOperation=SQL_UPDATE/SQL_REFRESH: assigning between an exact-numeric/interval C type and an interval SQL type (or vice versa) lost significant digits or had no representation in the target type, per the official guidance — the fifth named case.
Solutions / Resolution
- Check every date/timestamp/interval value's fields against their valid ranges, per the official guidance's implication.
- Choose interval field precisions (leading field and fractional-second precision) wide
enough to hold the values being converted, in both the SQL and C representations, per
the official guidance's implication, for
SQLExecute/SQLExecDirect/SQLPutData/SQLSetPos. - For fetch-side functions (
SQLExtendedFetch/SQLFetch/SQLGetData/SQLFetchScroll), bind a C interval type wide enough to represent the source SQL value, per the official guidance's implication.
Examples
N/A
No specific triggering statement is documented beyond an out-of-range interval/datetime field.
Diagnostic Checks
- Check the interval/datetime value's fields, and confirm each is within its valid range.
Related Errors / Related Topics
- -11104 — "Invalid datetime format" — a related datetime-value error, for a broader set of malformed date/timestamp values rather than specifically interval field overflow.
An interval or datetime field value overflowed its valid range — check each field.