Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Fetch type out of range" error when calling result.prior(), result.first(), result.last() or result.at_end() #368

Open
thibaudk opened this issue Jan 2, 2023 · 1 comment

Comments

@thibaudk
Copy link

thibaudk commented Jan 2, 2023

Environment

  • nanodbc version: 2.13.0-3 installed from aur
  • DBMS name/version: Microsoft SQL Server 2019 (RTM-GDR) (KB5014356) - 15.0.2095.3 (X64) Apr 29 2022 18:00:13 Copyright (C) 2019 Microsoft Corporation Express Edition (64-bit) on Windows Server 2016 Standard 10.0 <X64> (Build 14393: ) (Hypervisor)
  • ODBC connection string: i simply initialize the the connection object with {"dbName", "userName", "pwd"}
  • OS and Compiler: Archlinux, clang version 14.0.6
  • CMake settings: only -Dnanodbc_DIR:PATH=/usr/lib/cmake/nanodbc is set

Actual behavior

calling result.prior(), result.first(), result.last() or result.at_end() throws the following error:
nanodbc-2.13.0/nanodbc/nanodbc.cpp:2789: HY10: [Microsoft][ODBC Driver 18 for SQL Server]Fetch type out of range

I also noticed that result.position() always returns 0.
Basically, only result.next() seem to affect the current result set.

Disclaimer

I may be simply missing something in the configuration of unixODBC, or it could be a limitation of connecting to mssql on a windows server form a Linux machine. My apologies if this is not an actual issue of nanodbc.

@mloskot
Copy link
Member

mloskot commented Jan 2, 2023

Searching https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlfetchscroll-function for fetch type out of range yields:
image

Looks like we're back to the square of configurable cursors #93 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants