Skip to content

R connectivity with Oracle DB

4 messages · Madan Mohan, Brian Ripley, Duncan Murdoch +1 more

#
Hi Friends,

I am working on R-2.9.0 and i want to connect oracle through R, but i could
not find ROracle (zip file for windows) on CRAN Packages. Can anyone suggest
me how to connect Oracle from R in windows platform? I would be grateful if
u can provide me code aswell.

Thanks & Regards,
Madan
#
See http://cran.r-project.org/bin/windows/contrib/2.9/@ReadMe (ReadMe 
files are there to be read!) and consider the use of RODBC, which is 
used by lots of Oracle users as an R client on Windows.
On Thu, 28 May 2009, Madan Mohan wrote:

            

  
    
#
On 28/05/2009 6:03 AM, Madan Mohan wrote:
Get an ODBC driver from Oracle, and use RODBC.

Duncan Murdoch
#
Hello Madan, 
I am rather novice as well, so I went the ODBC way. 
If you define an ODBC connection to Oracle, with System DSN dsn-name,
the code to get the results of a query into, say, mydata is like :

library(RODBC) # First of all
channel <- odbcConnect("dsn-name", uid="someuser") # double quotes
required, it will ask for the password
# Return rows from an SQL query
mydata <- sqlQuery (channel, "Select .... put your query here ...") #
same as before
odbcClose(channel) # When you're done

HTH,
Gabriele Franzini 
ICT Applications Manager 
Nerviano Medical Sciences SRL 
Nerviano Italy