Informix Error -11119: Attribute cannot be set now.
Cause and resolution
Attribute cannot be set now.
This Informix ODBC error code is the same as SQLSTATE value HY011. The following functions can return this error code: SQLBulkOperations, SQLSetConnectAttr, SQLSetEnvAttr, SQLSetPos, and SQLSetStmtAttr.
For SQLBulkOperations and SQLSetPos, the driver was an ODBC 2.x driver; the SQL_ATTR_ROW_STATUS_PTR statement attribute was set; then SQLSetPos was called before SQLFetch, SQLFetchScroll, or SQLExtendedFetch was called.
For SQLSetConnectAttr, the Attribute argument was SQL_ATTR_TXN_ISOLATION, and a transaction was open.
For SQLSetEnvAttr, a connection handle has been allocated on EnvironmentHandle.(DM) The Attribute argument was SQL_ATTR_OUTPUT_NTS, and the SQL_ATTR_ODBC_VERSION attribute had not been set.
For SQLSetStmtAttr, the Attribute was SQL_ATTR_CONCURRENCY, SQL_ATTR_CURSOR_TYPE, SQL_ATTR_SIMULATE_CURSOR, or SQL_ATTR_USE_BOOKMARKS, and the statement was prepared.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-11119 fires when an attribute is set or a positioning function is called at a point in the
statement/connection lifecycle where it isn't allowed — per the official guidance, this is
the same as SQLSTATE value HY011, returnable by SQLBulkOperations,
SQLSetConnectAttr, SQLSetEnvAttr, SQLSetPos, and SQLSetStmtAttr.
- For
SQLBulkOperations/SQLSetPoson an ODBC 2.x driver:SQLSetPoscalled beforeSQLFetch/SQLFetchScroll/SQLExtendedFetch, whileSQL_ATTR_ROW_STATUS_PTRwas set, per the official guidance — the first named case. - For
SQLSetConnectAttr: theSQL_ATTR_TXN_ISOLATIONattribute changed while a transaction was already in progress, per the official guidance — the second named case. - For
SQLSetEnvAttr: a connection handle had already been allocated on theEnvironmentHandle,AttributewasSQL_ATTR_OUTPUT_NTS, andSQL_ATTR_ODBC_VERSIONhadn't been set yet, per the official guidance — the third named case. - For
SQLSetStmtAttr:AttributewasSQL_ATTR_CONCURRENCY,SQL_ATTR_CURSOR_TYPE,SQL_ATTR_SIMULATE_CURSOR, orSQL_ATTR_USE_BOOKMARKSwhile the statement was already prepared, per the official guidance — the fourth named case.
Solutions / Resolution
- Call
SQLFetch/SQLFetchScroll/SQLExtendedFetchbeforeSQLSetPos, per the official guidance, whenSQL_ATTR_ROW_STATUS_PTRis set. - Set
SQL_ATTR_TXN_ISOLATIONonly outside an active transaction, per the official guidance. - Set
SQL_ATTR_ODBC_VERSIONbefore allocating a connection handle, per the official guidance, ifSQL_ATTR_OUTPUT_NTSneeds to be set afterward. - Set
SQL_ATTR_CONCURRENCY/SQL_ATTR_CURSOR_TYPE/SQL_ATTR_SIMULATE_CURSOR/SQL_ATTR_USE_BOOKMARKSonly before the statement is prepared, per the official guidance.
Examples
N/A
No specific triggering statement is documented beyond an attribute/positioning call made at the wrong point in the lifecycle.
Diagnostic Checks
- Check the call sequence — confirm a fetch happened before
SQLSetPos, and that no transaction is active before changing isolation level.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -11119 in this set yet.
An attribute or positioning call was made at an unsupported point in the lifecycle — check the required call sequence for that attribute/function.