How to Connect R to Oracle?

database, oracle, r

Solution

See the help page for `odbcDriverConnect()`. `odbcDriverConnect()` does not accept `uid` or `pwd` arguments. You probably meant to use `odbcConnect()` instead:

odbcConnect(dsn = "DBIORES1", uid = "mhala", pwd = "XXXXXXX")

In addition to the `RODBC` package, there is the `RODM` package, which I believe is specifically designed for Oracle databases and is further described here: http://www.oracle.com/technetwork/articles/datawarehouse/saternos-r-161569.html . I do not use Oracle databases, so cannot comment on advantages of the two packages.

Problem

I need to connect R to oracle and I have been unsuccessful so far. I downloaded two packages: RODBC & RODM. This is the statement that I've been using: ``` DB <- odbcDriverConnect("DBIORES1",uid="mhala",pwd="XXXXXXX") ``` But I get this error: ``` Error in odbcDriverConnect("DBIORES1", uid = "mhalagan", pwd = "XXXXXXX") : unused argument(s) (uid = "mhalagan", pwd = "XXXXXXX") ``` What information do I need to be able to connect to an oracle database? Am I using the correct package?

Original source