Informix Error -11034: Invalid cursor name.
Cause and resolution
Invalid cursor name.
This Informix CLI error code is the same as SQLSTATE value 34000. The following functions can return this error code: SQLExecDirect(), SQLPrepare(), and SQLSetCursorName().
The argument szSqlStr contains a positioned update or delete statement, and the cursor referenced by the statement being executed is not open. Check that the cursor is executed.
For SQLExecDirect() or SQLPrepare(), the SQL statement contained a positioned UPDATE or DELETE, but the cursor that the statement references was not open. Make sure that the cursor for an UPDATE or DELETE statement is open.
For SQLSetCursorName(), the cursor name was invalid. For example, it might exceed the maximum allowable length. Make sure that the cursor name is valid.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-11034 fires when a positioned UPDATE/DELETE statement references a cursor that isn't
open — per the official guidance, this is the same as SQLSTATE value 34000, returnable by
SQLExecDirect(), SQLPrepare(), and SQLSetCursorName().
- A positioned
UPDATE/DELETEstatement whose named cursor isn't open, per the official guidance — the direct, only cause.
Solutions / Resolution
- Confirm the cursor has been executed (opened) before the positioned statement runs, per the official guidance.
Examples
N/A
No specific triggering statement is documented beyond a positioned statement referencing an unopened cursor.
Diagnostic Checks
- Check that the named cursor was successfully executed/opened before the positioned
UPDATE/DELETEruns against it.
Related Errors / Related Topics
- -11031 — "Invalid cursor state." A related cursor error, about a general state-mismatch on the statement handle rather than the specific named cursor not being open.
A positioned UPDATE/DELETE referenced a cursor that wasn't open — confirm the cursor was executed first.