[R] Rdbi and ODBC

roger bos roger.bos at gmail.com
Tue Feb 22 22:54:06 CET 2005


I have been using RODBC for a while with no complaints (R 2.0.1
patched under WinXP), then I saw a link
(http://grass.itc.it/statsgrass/r_and_dbms.html) showing that Rdbi
claims to run a query in 5 seconds that takes RODBC 4.3 minutes.  That
was hard enough for me to believe that I wanted to try some tests
myself, but I cannot get Rdbi to connect to my ODBC database.

Here is what works for RODBC for my setup:
conn <- odbcConnect("xf", "xfl2", "xfl2")

Now for Rdbi the documentation is lacking.  "?Rdbi" doesn't work and
"?dbConnect" gives little detail and no examples.

I tried all of the following without success:
conn <- dbConnect("ODBC()", dbname="xf", user="xfl2", password="xfl2")
conn <- dbConnect("ODBC", dbname="xf", user="xfl2", password="xfl2")
conn <- dbConnect(ODBC, dbname="xf", user="xfl2", password="xfl2")
conn <- dbConnect(ODBC(), dbname="xf", user="xfl2", password="xfl2")

Also, if this package is so fast, how come its not available on CRAN?

If I may ask a second question for my enlightenment.  It seems that
PostgreSQL and mySQL are pretty popular, but my database is in SQL
Server and I do not have the ability to change it.  How come every
package has native drivers to PostreSQL and Oracle but none of them
seem to have a native drive to SQL Server and I have to use ODBC?

Thanks in advance for any advice.




More information about the R-help mailing list