Informix Error -11067: Function sequence error.
Cause and resolution
Function sequence error.
An asynchronously executing function is called for the hstmt and is still executing when this function is called, or an attempt was made to use an hstmt out of sequence. Check the sequence of operations. For example, check that you are not trying to execute an EXECUTE statement before the PREPARE statement is finished.
This Informix CLI error code is the same as SQLSTATE value S1010. The following functions can return this error code: SQLBindCol(), SQLBindParameter(), SQLColAttributes(), SQLColumnPrivilages(), SQLColumns(), SQLDescribeCol(), SQLDisconnect(), SQLExecDirect(), SQLExecute(), SQLExtendedFetch(), SQLFetch(), SQLFreeConnect(), SQLFreeEnv(), SQLFreeStmt(), SQLForeignKeys(), SQLGetConnectOption(), SQLGetCursorName(), SQLGetData(), SQLGetFunctions(), SQLGetStmtOption(), SQLGetTypeInfo(), SQLMoreResults(), SQLNumParams(), SQLNumResultCols(), SQLParamData(), SQLPrepare(), SQLPrimaryKeys(), SQLProcedureColumns(), SQLProcedures(), SQLPutData(), SQLRowCount(), SQLSetConnectOption(), SQLSetCursorName(), SQLSetStmtOption(), SQLSpecialColumns(), SQLStatistics(), SQLTablePrivileges(), SQLTables(), and SQLTransact().
For SQLBindCol(), SQLBindParameter(), SQLColAttributes(), SQLColumnPrivilages(), SQLColumns(), SQLDescribeCol(), SQLDisconnect(), SQLExecDirect(), SQLExecute(), SQLExtendedFetch(), SQLFetch(), SQLFreeStmt(), SQLForeignKeys(), SQLGetCursorName(), SQLGetData(), SQLGetStmtOption(), SQLGetTypeInfo(), SQLMoreResults(), SQLNumParams(), SQLNumResultCols(), SQLPrepare(), SQLPrimaryKeys(), SQLProcedureColumns(), SQLProcedures(), SQLRowCount(), SQLSetConnectOption(), SQLSetCursorName(), SQLSetStmtOption(), SQLSpecialColumns(), SQLStatistics(), SQLTablePrivileges(), SQLTables(), and SQLTransact(), Informix CLI called SQLExecute(), SQLExecDirect(), or SQLSetPos() for the statement handle and returned SQL_NEED_DATA, which means that you called this function before data was sent for the data-at-execution parameters or columns. Wait until data is sent for all the data-at-execution parameters or columns before you call this function.
Additionally for SQLColAttributes(), SQLDescribeCol(), SQLNumParams(), and SQLNumResultCols(), you called this function before you called SQLPrepare() or SQLExecDirect for the statement handle. Do not call this function before SQLPrepare() or SQLExecDirect().
Additionally for SQLExecute(), the statement handle was not prepared due to one of the following conditions: (1) The statement handle was not in an executed state, (2) You opened a cursor on the statement handle and called SQLFetch() or SQLExtendedFetch(), (3) The statement handle was in an executed state but did not have a result set associated with it, or (4) The statement handle was in an executed state but you did not call SQLFetch() or SQLExtendedFetch(). Make sure that none of these conditions occurs.
Additionally for SQLExtendedFetch(), SQLFetch(), and SQLGetData(), one of the following problems occurred: (1) The statement handle was not in an executed state because you did not call SQLExecDirect(), SQLExecute(), or a catalog function before you called this function, or (2) You called this function after you called SQLFetch() and before you called SQLFreeStmt() with the SQL_CLOSE option. Make sure that neither of these conditions occurs.
For SQLFreeConnect(), you called this function before you called SQLDisconnect() for the connection handle.
For SQLFreeEnv(), at least one connection handle was in an allocated or connected state. Call SQLDisconnect() and SQLFreeConnect() for each connection handle before you call this function.
For SQLGetConnectOption(), SQLGetFunctions(), and additionally for SQLSetConnectOption(), Informix CLI called SQLBrowseConnect() for the connection handle and returned SQL_NEED_DATA, which means that you called this function before SQLBrowseConnect() returned SQL_SUCCESS_WITH_INFO or SQL_SUCCESS. Wait until SQLBrowseConnect() returns SQL_SUCCESS_WITH_INFO or SQL_SUCCESS before you call this function.
Additionally for SQLGetFunctions(), you called this function before you called SQLConnect(), SQLBrowseConnect(), or SQLDriverConnect(). Do not call this function before SQLConnect(), SQLBrowseConnect(), or SQLDriverConnect().
For SQLParamData(), the previous function call was to this function. Call this function only after you call SQLExecDirect() or SQLExecute() where the return code is SQL_NEED_DATA or after you call SQLPutData().
For SQLPutData(), the previous function call was to SQLExecDirect() or SQLExecute() where the return code was SQL_NEED_DATA. Call this function only after you call SQLParamData() or SQLPutData().
Additionally for SQLRowCount(), you called this function before you called SQLExecute() or SQLExecDirect() for the statement handle. Do not call this function before SQLExecute() or SQLExecDirect().
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-11067 fires when a statement handle is used out of sequence, or an asynchronously
executing function is still running when called again — per the official guidance, this is
the same as SQLSTATE value S1010, returnable by a wide range of CLI functions including
SQLBindCol(), SQLBindParameter(), SQLColAttributes(), SQLColumnPrivilages(), and
SQLColumns(), among others.
- An asynchronously executing function still running on the
hstmtwhen called again, per the official guidance — the first named case. - An
hstmtused out of the expected operation sequence, per the official guidance — the second named case, e.g. issuing anEXECUTEbefore the correspondingPREPAREfinishes.
Solutions / Resolution
- Check the sequence of operations, per the official guidance — confirm each step (prepare, execute, fetch, etc.) fully completes before the next one starts.
Examples
N/A
No specific triggering statement is documented beyond an out-of-sequence or still-executing function call.
Diagnostic Checks
- Review the call sequence on the affected
hstmt, and confirm no step starts before the prior one has actually completed.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -11067 in this set yet.
A statement handle was used out of sequence, or while a prior async call was still running — review the operation order.