RODBC not recognizing my odbc settings
Wow, I thought I was the only person working on this kind of stuff. I had to solve the same problem and found the best solution was to use rjdbc. This is much easier to configure as ODBC on linux or osx was very spotty. RJDBC performance is great as it uses the native ms sql server jar to execute the query. Here is an example right out of one of our scripts. You just need to download the sqljdbc4.jar from microsoft and then install.package("RJDBC") into your environment. I realized you are trying to get ODBC to work and I did get it to work on osx but I gave up due to time for linux.
library(RJDBC);
drv <- JDBC('com.microsoft.sqlserver.jdbc.SQLServerDriver', '/usr/local/project/dataproviders/jdbc/sqljdbc4.jar', identifier.quote="'");
ch <- dbConnect(drv, 'jdbc:sqlserver://the.server.address.net;databaseName=DataWarehouse', 'USERNAME', 'PASSWORD');
allsupp_allprod_allproc <- dbGetQuery(ch, paste("SELECT [Date], Sum([Fail]) as Numerator, Sum([Pass] + [Fail]) as Denominator,'' as Annotation,'True' as 'Use for CL' FROM [PSU_YieldData] Group by [Date] Order by [Date]"));
RODBC on macOS Catalina
I had the same issue connecting with Impala on Mac after some upgrades. The workaround was to make sure RODBC used unixodbc instead of iODBC as follows:
- install unixodbc. I used brew.
- Remove RODBC with remove.packages("RODBC")
- Reinstall RODBC from source and specify the path to unixodbc lib and include
with
install.packages("RODBC", type = "source", configure.args = c("--with-odbc-include=/usr/local/include/","--with-odbc-lib=/usr/local/lib/") )
On my computer unixodbc is in /usr/local
Related Topics
How to Allow Jenkins to Access The Files That Only Root or Some Specific Programs Have Access To
Append to /Etc/Apt/Sources.List
Angular Cli App Not Running When Deploying to Linux App Service
Substituting a String in Place of Variable in Shell
Replace System Call in Linux Kernel 3
Can't Register a Snapshot Repository in Elasticsearch
Self Updating Bash Script from Github
Hidden File .Env Not Copied Using Docker Copy
How to Get The System Home Directory in Cmake on Linux
How to Get Yesterday and Day Before Yesterday in Linux
Can 'Find' or Any Other Tool Search for Files Breadth-First
How to Check Out a Particular Version in Git from 'Git Log'
Do_Install Error While Running Custom Bitbake in Poky Build
How to Install Google Test on Ubuntu Without Root Access
Sudo Apt-Get Update Fail on Ubuntu 17.04