Informix Error -11307: In SQLExtendedFetch, only SQL_FETCH_NEXT is supported for SQL_SCROLL_FORWARD_ONLY cursors.
Cause and resolution
In SQLExtendedFetch, only SQL_FETCH_NEXT is supported for SQL_SCROLL_FORWARD_ONLY cursors.
This Informix ODBC error code is the same as SQLSTATE value S1000. The following function can return this error code: SQLExtendedFetch.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-11307 fires when SQLExtendedFetch is called with a fetch orientation other than
SQL_FETCH_NEXT on a SQL_SCROLL_FORWARD_ONLY cursor — per the official guidance, this is
the same as SQLSTATE value S1000.
- A fetch orientation other than
SQL_FETCH_NEXTon a forward-only cursor, per the official guidance — the direct, only cause.
Solutions / Resolution
- Use only
SQL_FETCH_NEXTforSQL_SCROLL_FORWARD_ONLYcursors, per the official guidance.
Examples
N/A
No specific triggering statement is documented beyond a non-SQL_FETCH_NEXT orientation on
a forward-only cursor.
Diagnostic Checks
- Check the cursor's scroll type, and confirm the fetch orientation is
SQL_FETCH_NEXTwhenever it'sSQL_SCROLL_FORWARD_ONLY.
Related Errors / Related Topics
- -11305 — "SQLGetTypeInfo supported for FORWARD_ONLY Cursors." The same forward-only-
cursor restriction, applied to
SQLGetTypeInforather thanSQLExtendedFetch. - -11086 — "Fetch type out of range." The same class of restriction, on
SQL_CURSOR_TYPE/fFetchTypegenerally rather than this specificSQL_SCROLL_FORWARD_ONLYcase.
SQLExtendedFetch on a forward-only cursor only supports SQL_FETCH_NEXT — use that
orientation.