Informix Error -11068: Operation invalid at this time.
Cause and resolution
Operation invalid at this time.
This Informix CLI error code is the same as SQLSTATE value S1011. The following functions can return this error code: SQLGetStmtOption(), SQLSetConnectOption(), and SQLSetStmtOption().
For SQLGetStmtOption(), fOption was SQL_GET_BOOKMARK and SQL_USE_BOOKMARKS was SQL_UB_OFF. If SQL_USE_BOOKMARKS is SQL_UB_OFF, do not use this option value.
For SQLSetConnectOption(), fOption was SQL_TXN_ISOLATION and a transaction was open. Make sure that no transactions are open before you use this option value.
For SQLSetStmtOption(), fOption was SQL_CONCURRENCY, SQL_SIMULATE_CURSOR, or SQL_CURSOR_TYPE and the statement was prepared. If the statement is prepared, do not use one of these option values.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-11068 fires when a statement/connect option is used in a context that doesn't currently
support it — per the official guidance, this is the same as SQLSTATE value S1011,
returnable by SQLGetStmtOption(), SQLSetConnectOption(), and SQLSetStmtOption().
- For
SQLGetStmtOption():fOptionwasSQL_GET_BOOKMARKwhileSQL_USE_BOOKMARKSwasSQL_UB_OFF, per the official guidance — bookmarks aren't available when disabled. - For
SQLSetConnectOption():fOptionwasSQL_TXN_ISOLATIONwhile a transaction was already active, per the official guidance — isolation level can't change mid-transaction. - For
SQLSetStmtOption():fOptionwasSQL_CONCURRENCY,SQL_SIMULATE_CURSOR, orSQL_CURSOR_TYPEwhile the statement was already prepared, per the official guidance — the third named case.
Solutions / Resolution
- Don't request
SQL_GET_BOOKMARKwhileSQL_USE_BOOKMARKSisSQL_UB_OFF, per the official guidance. - Set
SQL_TXN_ISOLATIONonly outside an active transaction, per the official guidance. - Don't set
SQL_CONCURRENCY,SQL_SIMULATE_CURSOR, orSQL_CURSOR_TYPEonce the statement is already prepared, per the official guidance.
Examples
N/A
No specific triggering statement is documented beyond an option used outside its supported context.
Diagnostic Checks
- Check whether bookmarks are enabled before requesting a bookmark option, and check for an active transaction before changing isolation level.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -11068 in this set yet.
A statement/connect option was used in a context that doesn't support it (bookmarks disabled, or an active transaction) — check the option's preconditions.