Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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 = "MHALAGAN2011") : unused argument(s) (uid = "mhalagan", pwd = "MHALAGAN2011")

What information do I need to be able to connect to an oracle database? Am I using the correct package?

share|improve this question

1 Answer 1

if you want a simple client you can use ROracle

library(ROracle)
con <- dbConnect(dbDriver("Oracle"), "scott","tiger")
res <- dbSendQuery(con,"select * from emp")
data <- fetch(res)
colnames(data) <- tolower(colnames(data))
> data
   empno  ename       job  mgr            hiredate  sal comm deptno
1   7369  SMITH     CLERK 7902 1980-12-16 23:00:00  800   NA     20
2   7499  ALLEN  SALESMAN 7698 1981-02-19 23:00:00 1600  300     30
3   7521   WARD  SALESMAN 7698 1981-02-21 23:00:00 1250  500     30
4   7566  JONES   MANAGER 7839 1981-04-01 23:00:00 2975   NA     20
5   7654 MARTIN  SALESMAN 7698 1981-09-27 23:00:00 1250 1400     30

Or, if you have oracle enterprise you can use oracle's ORE.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.