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

DBInterface.execute(f::Callable, stmt, params) throws error #385

Open
sdobber opened this issue Nov 6, 2024 · 0 comments
Open

DBInterface.execute(f::Callable, stmt, params) throws error #385

sdobber opened this issue Nov 6, 2024 · 0 comments

Comments

@sdobber
Copy link

sdobber commented Nov 6, 2024

When using the method of DBInterface.execute with an initial function argument, ODBC.jl throws an error due to an undefined close! function.

Error:

ERROR: MethodError: no method matching close!(::ODBC.Cursor{false, false})
Closest candidates are:
  close!(::ODBC.Statement) at C:\Users\ka031\.julia\packages\ODBC\mjMrW\src\dbinterface.jl:128
  close!(::ODBC.Connection) at C:\Users\ka031\.julia\packages\ODBC\mjMrW\src\dbinterface.jl:105
Stacktrace:
 [1] execute(f::typeof(identity), stmt::ODBC.Statement, params::NamedTuple{(), Tuple{}})
   @ DBInterface C:\Users\ka031\.julia\packages\DBInterface\1Gmxx\src\DBInterface.jl:137
 [2] execute(f::Function, conn::ODBC.Connection, sql::String, params::NamedTuple{(), Tuple{}})
   @ DBInterface C:\Users\ka031\.julia\packages\DBInterface\1Gmxx\src\DBInterface.jl:144
 [3] execute(f::Function, conn::ODBC.Connection, sql::String; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ DBInterface C:\Users\ka031\.julia\packages\DBInterface\1Gmxx\src\DBInterface.jl:153
 [4] execute(f::Function, conn::ODBC.Connection, sql::String)
   @ DBInterface C:\Users\ka031\.julia\packages\DBInterface\1Gmxx\src\DBInterface.jl:153
 [5] top-level scope
   @ REPL[5]:1

MWE:

using ODBC
db= ODBC.Connection(...)  # connect to a MSSQL db, for example via a Docker image
query = "SELECT @@VERSION"
DBInterface.execute(db, query)  # works
DBInterface.execute(identity, db, query)  # throws error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant