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

ODBC.load fails with "wrong" error message if a column is Vector{Missing} #342

Open
lawless-m opened this issue May 20, 2022 · 0 comments
Open

Comments

@lawless-m
Copy link
Contributor

lawless-m commented May 20, 2022

This is a bit of a "well don't do that then, what did you expect?!" but I found it as part of my ETL pipeline when a CSV file had all the rows with no entries in the same column (see below).

The immediate solution is to make sure there are no such columns.

I think I have found two problems as Example 1 is the MWE but the output of Example 2 is my actual stack trace and the error is different.

Example 3 shows you can have Union{Missing, Int64} as a column type and it works fine
Example 4 likewise with Union(Missing, String)
but Example 5 shows you have to force CSV to not use InlineStrings but that's just me including it to show why I used that in Example 2

Example 1

julia> df = CSV.read(IOBuffer("a,b\n1,\n2,\n3,\n"), DataFrame)
3×2 DataFrame
 Row │ a      b       
     │ Int64  Missing 
─────┼────────────────
   1 │     1  missing 
   2 │     2  missing 
   3 │     3  missing 
3×2 DataFrame

julia> ODBC.load(df, conn, "abcm")
┌ Warning: error creating table
│   (e, catch_backtrace()) =
│    KeyError: key Missing not found
│    Stacktrace:
│      [1] getindex
│        @ .\dict.jl:481 [inlined]
│      [2] sqltype(conn::ODBC.Connection, T::Type)
│        @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:35
│      [3] #38
│        @ .\none:0 [inlined]
│      [4] iterate
│        @ .\generator.jl:47 [inlined]
│      [5] collect_to!
│        @ .\array.jl:782 [inlined]
│      [6] collect_to_with_first!
│        @ .\array.jl:760 [inlined]
│      [7] collect(itr::Base.Generator{Tuple{DataType, DataType}, ODBC.var"#38#40"{ODBC.Connection}})
│        @ Base .\array.jl:734
│      [8] createtable(conn::ODBC.Connection, nm::String, sch::Tables.Schema{(:a, :b), Tuple{Int64, Missing}}; debug::Bool, quoteidentifiers::Bool, createtableclause::String, columnsuffix::Dict{Any, Any})
│        @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:43
│      [9] load(itr::DataFrame, conn::ODBC.Connection, name::String; append::Bool, quoteidentifiers::Bool, debug::Bool, limit::Int64, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
│        @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:88
│     [10] load(itr::DataFrame, conn::ODBC.Connection, name::String)
│        @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:76
│     [11] top-level scope
│        @ REPL[18]:1
│     [12] eval
│        @ .\boot.jl:373 [inlined]
│     [13] eval_user_input(ast::Any, backend::REPL.REPLBackend)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:150
│     [14] repl_backend_loop(backend::REPL.REPLBackend)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:246
│     [15] start_repl_backend(backend::REPL.REPLBackend, consumer::Any)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:231
│     [16] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:364
│     [17] run_repl(repl::REPL.AbstractREPL, consumer::Any)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:351
│     [18] (::Base.var"#930#932"{Bool, Bool, Bool})(REPL::Module)
│        @ Base .\client.jl:394
│     [19] #invokelatest#2
│        @ .\essentials.jl:716 [inlined]
│     [20] invokelatest
│        @ .\essentials.jl:714 [inlined]
│     [21] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
│        @ Base .\client.jl:379
│     [22] exec_options(opts::Base.JLOptions)
│        @ Base .\client.jl:309
│     [23] _start()
│        @ Base .\client.jl:495
└ @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:90
ERROR: 42S02: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name 'abcm'.42000: [Microsoft][SQL Server Native Client 11.0][SQL Server]Statement(s) could not be prepared.
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:33
 [2] execute(stmt::ODBC.API.Handle)
   @ ODBC.API C:\Users\me\.julia\packages\ODBC\qhwMX\src\API.jl:114
 [3] execute(stmt::ODBC.Statement, params::Tables.Row{DataFrameRow{DataFrame, DataFrames.Index}}; debug::Bool, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\dbinterface.jl:164
 [4] (::ODBC.var"#46#47"{Bool, Int64, ODBC.Connection})()
   @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:102
 [5] transaction(f::ODBC.var"#46#47"{Bool, Int64, ODBC.Connection}, conn::ODBC.Connection)
   @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:112
 [6] load(itr::DataFrame, conn::ODBC.Connection, name::String; append::Bool, quoteidentifiers::Bool, debug::Bool, limit::Int64, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:96
 [7] load(itr::DataFrame, conn::ODBC.Connection, name::String)
   @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:76
 [8] top-level scope
   @ REPL[18]:1

Example 2

julia> cdf = CSV.read("filename.csv", DataFrame; stringtype=String);

julia> ODBC.load(cdf, conn, "c")
┌ Warning: error creating table
│   (e, catch_backtrace()) =
│    UndefVarError: T not defined
│    Stacktrace:
│      [1] sqltype(conn::ODBC.Connection, #unused#::Type{Missing})
│        @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:13
│      [2] (::ODBC.var"#38#40"{ODBC.Connection})(T::Type)
│        @ ODBC .\none:0
│      [3] iterate
│        @ .\generator.jl:47 [inlined]
│      [4] collect_to!(dest::Vector{String}, itr::Base.Generator{Tuple{DataType, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, DataType, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, 
Union, Union, DataType, Union, Union, Union, Union, Union, Union, Union, DataType, DataType, DataType, DataType, DataType, DataType, DataType, DataType, DataType, DataType, Union, Union, DataType, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, DataType, DataType, 
Union, Union, DataType, Union, DataType, DataType, DataType, Union, Union, DataType, DataType, DataType, Union, DataType, Union, Union, Union, DataType, DataType, Union, DataType, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, DataType, DataType, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, DataType}, ODBC.var"#38#40"{ODBC.Connection}}, offs::Int64, st::Int64)
│        @ Base .\array.jl:782
│      [5] collect_to_with_first!
│        @ .\array.jl:760 [inlined]
│      [6] collect(itr::Base.Generator{Tuple{DataType, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, DataType, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, DataType, Union, Union, Union, Union, Union, Union, Union, DataType, DataType, DataType, DataType, DataType, DataType, DataType, DataType, DataType, DataType, Union, 
Union, DataType, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, DataType, DataType, Union, Union, DataType, Union, DataType, DataType, DataType, Union, Union, DataType, DataType, DataType, Union, DataType, Union, Union, Union, DataType, DataType, Union, DataType, 
Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, DataType, DataType, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, Union, DataType}, ODBC.var"#38#40"{ODBC.Connection}})    
│        @ Base .\array.jl:734
│      [7] createtable(conn::ODBC.Connection, nm::String, sch::Tables.Schema{(:COE, :CYNAME, :ADR1, :ADD2, :AR3, :AR4, :COCODE, :PAY1, :PAY2, :PAY3, :PAY4, :INCOTERMS, :SALES1, :SALES2, :CONTACT, :PHONE, :FAX, :EMAIL, :EDI, :SELLCO, :TERR, :ORDTYP, :SEQTYP, :SLACC, :EVCUSER, :EVRST, :EVVNO, :EESTST, :EVTMS, :EVTRANTYPE, :EVMODE, :EVIND, :CUSCLASS, :SICCODE, :CURR, :NOTES, :CUSTOMER, :PROSPECT, :VATANAL, :ANALYSISCODE, :PROFILE, :CUEVDECLSSD, :CUEVDECLESL, :CUUSER01, :CUUSER02, :CUUSER03, :CUUSER04, :CUUSER05, :CUUSER06, :CUUSER07, :CUUSER08, :CUUS09, :CUUSER10, :CUALTINVCURR, :CUCOSTMODEL, :CUENQMARKUP, :CUOTHADD1, :CUOTHADD2, :CUOTHADD3, :CUOTHADD4, :CUOTHADD5, :CUMOBILE, :CUWWW, :CUCTRYCODE, :CUOTHCTRYCODE, :CUALERT, :CUALERTTEXT, :CUEVREVCHRG, :UF_EORI, :UF_CONSIGNE, :UF_FINALADD, :UF_ACCHAND, :UF_CSA, :UF_PALLETCHGTYPE, :UF_PROMQTYLVL, :UF_EXPPROOF, :UF_LABTEXT1, :UF_LABTEXT2, :UF_ROUTING, :UF_AREA, :UF_FREIGHT1, :UF_FREIGHT2, :UF_COLLECT1, :UF_FCOLLTRCDE, :UF_INTADD1, :UF_FDELYCNTRCDE, :UF_DELTELNO, :UF_DELCONTACT, :UF_SUCCCARR, :UF_FRTADINF, :UF_FRTTERMS, :UF_WH_INSTR, :UF_PLLLABEL, :UF_XCONSOL, :UF_XSECURITY, :UF_BLACKWRAP, :UF_CORNERS, :UF_CROSSDOCK, :UF_THERMALWRAP, :UF_PLLHTREST, :UF_SAADDOCS, :UF_VGM, :UF_TYGARD, :UF_WHINSTR2, :UF_STINVDEC, Symbol("UF_INGLABELS?"), :UF_INGLBLLANG, :UF_INGLBLLANG2, :UF_LABELFOOTR, :UF_LABTEMP, :UF_ALTPROF1, :UF_ALTPROF2, :UF_ALTPROF3, :UF_ALTPROF4, :UF_ALTPROF5, :UF_ALTPROF6, :UF_ALTPROF7, :UF_ALTPROF8, :UF_ALTPROF9, :UF_ALTPROF10, :UF_ALTPROF11, 
:UF_STOP, :UF_STOPUSER, :UF_STOPDATE, :UF_DD, :UF_CR_AVAIL, :UF_CR_OVR_EXP, :UF_CRMCOMPANYID, :UF_CRMDEFAULT), Tuple{String, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, 
String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Int64, Union{Missing, String}, Union{Missing, Int64}, Union{Missing, Int64}, Union{Missing, String}, Union{Missing, Bool}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, Int64}, Union{Missing, Int64}, Union{Missing, Int64}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Missing, Union{Missing, Bool}, Union{Missing, Bool}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, Bool}, Union{Missing, Bool}, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Union{Missing, String}, Union{Missing, String}, Missing, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, Bool}, Union{Missing, String}, Union{Missing, Bool}, Union{Missing, String}, Missing, Missing, Union{Missing, String}, Union{Missing, String}, String, Union{Missing, Int64}, Missing, Missing, Missing, Union{Missing, String}, Union{Missing, String}, Missing, Missing, Missing, Union{Missing, String}, Missing, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Missing, Missing, Union{Missing, String}, Missing, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Missing, Missing, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, String}, Union{Missing, Float64}, Union{Missing, String}, Union{Missing, Int64}, Missing}}; debug::Bool, quoteidentifiers::Bool, createtableclause::String, columnsuffix::Dict{Any, Any})
│        @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:43
│      [8] load(itr::DataFrame, conn::ODBC.Connection, name::String; append::Bool, quoteidentifiers::Bool, debug::Bool, limit::Int64, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
│        @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:88
│      [9] load(itr::DataFrame, conn::ODBC.Connection, name::String)
│        @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:76
│     [10] top-level scope
│        @ REPL[14]:1
│     [11] eval
│        @ .\boot.jl:373 [inlined]
│     [12] eval_user_input(ast::Any, backend::REPL.REPLBackend)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:150
│     [13] repl_backend_loop(backend::REPL.REPLBackend)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:246
│     [14] start_repl_backend(backend::REPL.REPLBackend, consumer::Any)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:231
│     [15] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:364
│     [16] run_repl(repl::REPL.AbstractREPL, consumer::Any)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:351
│     [17] (::Base.var"#930#932"{Bool, Bool, Bool})(REPL::Module)
│        @ Base .\client.jl:394
│     [18] #invokelatest#2
│        @ .\essentials.jl:716 [inlined]
│     [19] invokelatest
│        @ .\essentials.jl:714 [inlined]
│     [20] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
│        @ Base .\client.jl:379
│     [21] exec_options(opts::Base.JLOptions)
│        @ Base .\client.jl:309
│     [22] _start()
│        @ Base .\client.jl:495
└ @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:90
ERROR: 42S02: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name 'c'.42000: [Microsoft][SQL Server Native Client 11.0][SQL Server]Statement(s) could not be prepared.
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:33
 [2] execute(stmt::ODBC.API.Handle)
   @ ODBC.API C:\Users\me\.julia\packages\ODBC\qhwMX\src\API.jl:114
 [3] execute(stmt::ODBC.Statement, params::Tables.Row{DataFrameRow{DataFrame, DataFrames.Index}}; debug::Bool, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\dbinterface.jl:164
 [4] (::ODBC.var"#46#47"{Bool, Int64, ODBC.Connection})()
   @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:102
 [5] transaction(f::ODBC.var"#46#47"{Bool, Int64, ODBC.Connection}, conn::ODBC.Connection)
   @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:112
 [6] load(itr::DataFrame, conn::ODBC.Connection, name::String; append::Bool, quoteidentifiers::Bool, debug::Bool, limit::Int64, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:96
 [7] load(itr::DataFrame, conn::ODBC.Connection, name::String)
   @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:76
 [8] top-level scope
   @ REPL[14]:1

Example 3

julia> df = CSV.read(IOBuffer("a,b\n1,1\n2,\n3,\n"), DataFrame)
3×2 DataFrame
 Row │ a      b       
     │ Int64  Int64?  
─────┼────────────────
   1 │     1        1
   2 │     2  missing 
   3 │     3  missing 

julia> ODBC.load(df, conn, "abcmm")
"\"abcmm\""

julia> 

Example 4

julia> CSV.read(IOBuffer("a,b\n1,b\n2,\n3,\n"), DataFrame; stringtype=String)
3×2 DataFrame
 Row │ a      b       
     │ Int64  String? 
─────┼────────────────
   1 │     1  b
   2 │     2  missing 
   3 │     3  missing 

julia> ODBC.load(mdf, conn, "abcmms")
"\"abcmms\""

Example 5


julia> mdf = CSV.read(IOBuffer("a,b\n1,b\n2,\n3,\n"), DataFrame)
3×2 DataFrame
 Row │ a      b        
     │ Int64  String1? 
─────┼─────────────────
   1 │     1  b
   2 │     2  missing  
   3 │     3  missing  

julia> ODBC.load(mdf, conn, "abcmmsss")
┌ Warning: error creating table
│   (e, catch_backtrace()) =
│    KeyError: key String1 not found
│    Stacktrace:
│      [1] getindex
│        @ .\dict.jl:481 [inlined]
│      [2] sqltype(conn::ODBC.Connection, T::Type)
│        @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:35
│      [3] sqltype(conn::ODBC.Connection, #unused#::Type{Union{Missing, String1}})
│        @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:13
│      [4] (::ODBC.var"#38#40"{ODBC.Connection})(T::Type)
│        @ ODBC .\none:0
│      [5] iterate
│        @ .\generator.jl:47 [inlined]
│      [6] collect_to!
│        @ .\array.jl:782 [inlined]
│      [7] collect_to_with_first!
│        @ .\array.jl:760 [inlined]
│      [8] collect(itr::Base.Generator{Tuple{DataType, Union}, ODBC.var"#38#40"{ODBC.Connection}})
│        @ Base .\array.jl:734
│      [9] createtable(conn::ODBC.Connection, nm::String, sch::Tables.Schema{(:a, :b), Tuple{Int64, Union{Missing, String1}}}; debug::Bool, quoteidentifiers::Bool, createtableclause::String, columnsuffix::Dict{Any, Any})
│        @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:43
│     [10] load(itr::DataFrame, conn::ODBC.Connection, name::String; append::Bool, quoteidentifiers::Bool, debug::Bool, limit::Int64, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
│        @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:88
│     [11] load(itr::DataFrame, conn::ODBC.Connection, name::String)
│        @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:76
│     [12] top-level scope
│        @ REPL[35]:1
│     [13] eval
│        @ .\boot.jl:373 [inlined]
│     [14] eval_user_input(ast::Any, backend::REPL.REPLBackend)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:150
│     [15] repl_backend_loop(backend::REPL.REPLBackend)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:246
│     [16] start_repl_backend(backend::REPL.REPLBackend, consumer::Any)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:231
│     [17] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:364
│     [18] run_repl(repl::REPL.AbstractREPL, consumer::Any)
│        @ REPL C:\Users\me\julia-1.7.2\share\julia\stdlib\v1.7\REPL\src\REPL.jl:351
│     [19] (::Base.var"#930#932"{Bool, Bool, Bool})(REPL::Module)
│        @ Base .\client.jl:394
│     [20] #invokelatest#2
│        @ .\essentials.jl:716 [inlined]
│     [21] invokelatest
│        @ .\essentials.jl:714 [inlined]
│     [22] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
│        @ Base .\client.jl:379
│     [23] exec_options(opts::Base.JLOptions)
│        @ Base .\client.jl:309
│     [24] _start()
│        @ Base .\client.jl:495
└ @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:90
ERROR: MethodError: Cannot `convert` an object of type 
  Vector{Union{Missing, String1}} to an object of type 
  Union{Vector{ODBC.API.SQLTime}, Vector{Union{Missing, ODBC.API.SQLTime}}, Vector{Union{Missing, ODBC.API.SQLTimestamp}}, Vector{Union{Missing, ODBC.API.SQLDate}}, Vector{Union{Missing, Bool}}, Vector{Union{Missing, Int64}}, Vector{Union{Missing, Int32}}, Vector{Union{Missing, Int16}}, Vector{Union{Missing, Int8}}, Vector{Union{Missing, Float64}}, Vector{ODBC.API.SQLDate}, Vector{ODBC.API.SQLTimestamp}, Vector{Missing}, Vector{Union{Missing, Float32}}, Vector{Base.UUID}, Vector{Bool}, Vector{Float32}, Vector{Float64}, Vector{Int16}, Vector{Int32}, Vector{Int64}, Vector{Int8}, Vector{Union{Missing, Base.UUID}}, Vector{UInt8}, String}
Closest candidates are:
  convert(::Type{T}, ::T) where T at C:\Users\me\julia-1.7.2\share\julia\base\essentials.jl:218
Stacktrace:
  [1] ODBC.Buffer(x::String1)
    @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\utils.jl:114
  [2] ODBC.Binding(stmt::ODBC.API.Handle, x::String1, i::Int64)
    @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\utils.jl:251
  [3] (::ODBC.var"#5#6"{ODBC.API.Handle})(::Tuple{Int64, String1})
    @ ODBC .\none:0
  [4] iterate
    @ .\generator.jl:47 [inlined]
  [5] collect_to!(dest::Vector{ODBC.Binding}, itr::Base.Generator{Base.Iterators.Enumerate{Tables.Row{DataFrameRow{DataFrame, DataFrames.Index}}}, ODBC.var"#5#6"{ODBC.API.Handle}}, offs::Int64, st::Tuple{Int64, Int64})
    @ Base .\array.jl:782
  [6] collect_to_with_first!
    @ .\array.jl:760 [inlined]
  [7] collect(itr::Base.Generator{Base.Iterators.Enumerate{Tables.Row{DataFrameRow{DataFrame, DataFrames.Index}}}, ODBC.var"#5#6"{ODBC.API.Handle}})     
    @ Base .\array.jl:734
  [8] bindparams
    @ C:\Users\me\.julia\packages\ODBC\qhwMX\src\utils.jl:290 [inlined]
  [9] execute(stmt::ODBC.Statement, params::Tables.Row{DataFrameRow{DataFrame, DataFrames.Index}}; debug::Bool, kw::Base.Pairs{Symbol, Union{}, Tuple{}, 
NamedTuple{(), Tuple{}}})
    @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\dbinterface.jl:162
 [10] (::ODBC.var"#46#47"{Bool, Int64, ODBC.Connection})()
    @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:102
 [11] transaction(f::ODBC.var"#46#47"{Bool, Int64, ODBC.Connection}, conn::ODBC.Connection)
    @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:112
 [12] load(itr::DataFrame, conn::ODBC.Connection, name::String; append::Bool, quoteidentifiers::Bool, debug::Bool, limit::Int64, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:96
 [13] load(itr::DataFrame, conn::ODBC.Connection, name::String)
    @ ODBC C:\Users\me\.julia\packages\ODBC\qhwMX\src\load.jl:76
 [14] top-level scope
    @ REPL[35]:1
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