Informix Error -11013: Restricted data type attribute violation.
Cause and resolution
Restricted data type attribute violation.
This Informix CLI error code is the same as SQLSTATE value 07006. The following functions can return this error code: SQLBindParameter(), SQLExtendedFetch(), SQLFetch(), and SQLGetData().
A data value could not be converted to the C data type specified by the fCType argument of the SQLBindCol function. This error occurs when you try to retrieve data types that are unsupported by the CLI driver or the value in the fCType argument is not recognized. Confirm that the data type you are requesting is supported by the database server and confirm that the value you are supplying for the fCType argument is valid.
For SQLBindParameter(), it is not possible to convert the result data (the data value associated with the Informix CLI C data type (fCType) argument) to the data type of the parameter (the data value associated with the Informix CLI SQL data type (fSqlType) argument). Set the Informix CLI C and SQL data types to values that make it possible to convert the result data to the data type of the parameter.
For SQLExtendedFetch() or SQLFetch(), it is not possible to convert one of the result data values to the specified data type (the Informix CLI C data type (fCType) argument for SQLBindCol()). For each data value that the function fetches, set the associated Informix CLI C data type argument for SQLBindCol() to a value that makes it possible to convert the data value to the specified data type.
For SQLGetData(), it is not possible to convert the data value to the specified data type (the Informix CLI C data type (fCType) argument). Set Informix CLI C data type to a value that makes it possible to convert the data value to the data type.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-11013 fires when a data value can't be converted to the C data type an fCType argument
specifies — per the official guidance, this is the same as SQLSTATE value 07006.
- For
SQLBindParameter(): the result data (thefCTypeC data type) can't be converted to the parameter's SQL data type (fSqlType), per the official guidance — the first named case. - For
SQLExtendedFetch()/SQLFetch(): a fetched result value can't be converted to the C data typeSQLBindCol()specified for that column, per the official guidance — the second named case. - For
SQLGetData(): the retrieved data value can't be converted to the specifiedfCType, per the official guidance — the third named case.
Solutions / Resolution
- For
SQLBindParameter(): set the CLI C and SQL data types to values that make the conversion possible, per the official guidance. - For
SQLExtendedFetch()/SQLFetch(): set each fetched column'sSQLBindCol()C data type to a value that makes the conversion possible, per the official guidance. - For
SQLGetData(): set the CLI C data type to a value that makes the conversion possible, per the official guidance.
Examples
N/A
No specific triggering statement is documented beyond an unsupported/unrecognized C data type.
Diagnostic Checks
- Check the
fCTypeargument passed toSQLBindCol()/SQLBindParameter(), and confirm it names a data type both the server and driver support.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -11013 in this set yet.
A data value couldn't be converted to the requested C data type — confirm fCType names a
type the driver and server both support.