Informix Error -11026: Error in assignment.
Cause and resolution
Error in assignment.
The argument szSqlStr contains an SQL statement that contains a parameter or literal, and the value is incompatible with the data type of the associated table column. Check the list of compatible data types associated with the table column.
This Informix CLI error code is the same as SQLSTATE value 22005. The following functions can return this error code: SQLExecDirect(), SQLExecute(), SQLExtendedFetch(), SQLFetch(), SQLGetData(), SQLPrepare(), and SQLPutData().
For SQLExecDirect(), SQLExecute(), or SQLPrepare(), the SQL statement or prepared statement contained a parameter or literal that was incompatible with the data type of the associated column. Change the statement so that each parameter and literal is compatible with the data type of the column.
For SQLExtendedFetch() or SQLFetch(), the function fetched a zero-length string that you had bound to a numeric data type, so the function converted the string to a zero. Change the data type of the parameter that is bound to the string.
For SQLGetData() or SQLPutData(), the data type for the column is incompatible with the data type for the parameter. Change the data type for the parameter so that it is compatible with the data type for the column.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-11026 fires when a parameter or literal's value is incompatible with its target column's
data type — per the official guidance, this is the same as SQLSTATE value 22005, returnable
by SQLExecDirect(), SQLExecute(), SQLExtendedFetch(), SQLFetch(), SQLGetData(),
SQLPrepare(), and SQLPutData().
- For
SQLExecDirect()/SQLExecute()/SQLPrepare(): a statement (or prepared statement) with a parameter/literal incompatible with its target column's data type, per the official guidance — the first named case. - For
SQLExtendedFetch()/SQLFetch(): a fetched zero-length string bound to a numeric data type, per the official guidance — converted to zero, the second named case. - For
SQLGetData()/SQLPutData(): the column's data type incompatible with the bound parameter's data type, per the official guidance — the third named case.
Solutions / Resolution
- For
SQLExecDirect()/SQLExecute()/SQLPrepare(): change the statement so every parameter/literal is compatible with its target column's data type, per the official guidance. - For
SQLExtendedFetch()/SQLFetch(): change the data type of the parameter bound to the fetched string, per the official guidance. - For
SQLGetData()/SQLPutData(): change the parameter's data type so it's compatible with the column's data type, per the official guidance.
Examples
N/A
No specific triggering statement is documented beyond a type-incompatible assignment.
Diagnostic Checks
- Check the target column's declared data type, and confirm every parameter/literal assigned to it is compatible.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -11026 in this set yet.
A parameter or literal's value is incompatible with its target column's data type — check the column's declared type.