JuliaDatabases / ODBC.jl

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

"000" nvarchar converting to "0000/0/0" #337

Open kent-orr opened 2 years ago

kent-orr commented 2 years ago

Windows 10, pulling from Microsoft SQL Server.

I have a column in the database that has strings "000", "001" etc. which are changing to "0000/0/0" or sometimes "0000/0/5" when I convert the cursor to a DataFrame. The DataFrame result is a String. The conversion is not reliable, "002" does not always convert to "0000/0/2".

Below the stdout from the raw cursor object. the column in questions is named new_chlocation.

ODBC.Cursor{false, false}(ODBC.API.Handle(3, Ptr{Nothing} @0x00000000797cd360), -1, 1, 
[:new_chlocation], Type[Union{Missing, String}], Dict(:new_chlocation => 1), 0, 1, 
ODBC.Binding[ODBC.Binding(1, -9, ODBC.Buffer(UInt8[0x30, 0x02, 0x01, 0x02, 0x00, 0x00]), 6, 
[224975840], false, 0)], AbstractVector[], Any["column name" "column type" "sql type" "c type" 
"sizes" "nullable" "long data"; :new_chlocation Union{Missing, String} "SQL_WVARCHAR" "SQL_C_CHAR"
6 true false])
ssingh13-rms commented 2 years ago

could you also share the version of ODBC.jl you're using? Julia too please.

kent-orr commented 2 years ago

git-tree-sha1 = "7e3ce82387793ee6e787f9dbf78728602f97c7ad" uuid = "be6f12e9-ca4f-5eb2-a339-a4f995cc0291" version = "1.0.4"