You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was bit by a bug when testing out the odbc-package. I couldn't understand why my joins in dplyr didn't work as expected. After a while I found out that the type casting of bigint values didn't work as expected. Below is an example from our in house database, and a comparison with RSQLServer.
Database
SQL Server 2012
Non-reproducible example
library(odbc)
library(DBI)
# Using odbc
dbConnect(odbc::odbc(),"rt; UID=xxxxx; PWD=yyyyy") ->db
dbGetQuery(db,"USE RT; SELECT TOP 1 DelytaID, CAST(DelytaID AS char) AS DelytaCAST FROM dbo.vy_Delyteregister")
# Output# DelytaID DelytaCAST# 1 -603275544 81001103080 # Using RSQLServer
dbConnect(RSQLServer::SQLServer(),"RT") ->db
dbGetQuery(db,"USE RT; SELECT TOP 1 DelytaID, CAST(DelytaID AS char) AS DelytaCAST FROM dbo.vy_Delyteregister")
# Output# DelytaID DelytaCAST# 1 81001103080 81001103080
Session Info
devtools::session_info()
#Session info #-------------------------------------------------------------------------------------------------#setting value # version R version 3.3.2 (2016-10-31)# system x86_64, darwin13.4.0 # ui RStudio (1.0.136) # language (EN) # collate sv_SE.UTF-8 # tz Europe/Stockholm # date 2017-03-08 # odbc 1.0.1 2017-02-17 Github (rstats-db/odbc@8abb2ab) # RSQLServer 0.2.099 2016-09-28 Github (imanuelcostigan/RSQLServer@0b16383)
The text was updated successfully, but these errors were encountered:
Problem retrieving bigint values
I was bit by a bug when testing out the odbc-package. I couldn't understand why my joins in dplyr didn't work as expected. After a while I found out that the type casting of bigint values didn't work as expected. Below is an example from our in house database, and a comparison with RSQLServer.
Database
SQL Server 2012
Non-reproducible example
Session Info
The text was updated successfully, but these errors were encountered: