-
Notifications
You must be signed in to change notification settings - Fork 62
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
Documentation: Dec64 type conversion to Integer #288
Comments
aalexandersson
changed the title
Dec64 type conversion to Integer
Documentation: Dec64 type conversion to Integer
Jun 3, 2020
Thanks for opening an issue! I added some example docs in the "Getting Started" section of the docs; hopefully that helps. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am a Julia beginner and do not know how to convert column type
Union{Missing, Dec64}
to Integer in the output from ODBC. I am using Julia 1.4.2 and ODBC 1.0.0 on Windows 10 with an Oracle database driver.The result of
DBInterface.execute(conn, sql)
on my SQL query isODBC.Cursor{false,false}
which at the end includes "metadata" with a3x7 Array{Any,2}
with two columns for ZIPCODE_ZIP and ZIPCODE_COUNTY of column typeUnion{Missing, Dec64}
.Ideally, I would like to avoid the conversion and if possible simply extract the two
Dec64
type columns as Integer.I tried
convert(Int32, get(x.ZIPCODE_ZIP))
(based on https://discourse.julialang.org/t/decfp-type-conversion-to-integer/5752 and https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/) but get errorHaving a documented example of how to convert the data type or to get the wanted data type directly would be very helpful to me as a beginner for using ODBC.
Edit: I think display formatting is what I want, rather than conversion. This is the easiest solution I found to get rid of the decimals:
The text was updated successfully, but these errors were encountered: