JuliaDatabases / ODBC.jl

An ODBC interface for the Julia programming language
https://odbc.juliadatabases.org/stable
Other
106 stars 63 forks source link

params argument in DBInterface.execute argument not option. #317

Closed justinjjlee closed 3 years ago

justinjjlee commented 3 years ago

With ODBC connection, I am trying to run

conn = DBInterface.connect(ODBC.Connection, "Driver={SQL Server};SERVER=10.20.20.34;USER=root;PWD=")

DBInterface.execute(conn, sql) |> DataFrame

Seems like I am getting the error for v.1.0.0 and v.1.0.4.

ERROR: MethodError: execute(::ODBC.Connection, ::String, ::Tuple{}) is ambiguous. Candidates:
  execute(conn::ODBC.Connection, sql::AbstractString, params; debug, kw...)

What argument should I put for params? I was not able to see any in the documentation, and the following

DBInterface.execute(conn, sql, params = ()) |> DataFrame

leads to,

ERROR: MethodError: no method matching ODBC.Cursor(::ODBC.API.Handle; debug=false, params=())
Closest candidates are:
  ODBC.Cursor(::Any; iterate_rows, ignore_driver_row_count, normalizenames, debug) at C:\Users\.julia\packages\ODBC\qhwMX\src\dbinterface.jl:215 got unsupported keyword argument "params"
quinnj commented 3 years ago

I think this should be fixed by https://github.com/JuliaDatabases/DBInterface.jl/pull/33; there was a change released yesterday that caused this and I've made a bugfix release tonight to rectify