[R] R to Oracle via RODBC

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Sat Aug 3 08:34:55 CEST 2002


RODBC has not been updated for R 1.5.x (and hence is in the Devel area on
CRAN.  One issue is the change in NA handling in R, but I think this is
incorrect usage.

On Fri, 2 Aug 2002, Vikram Khurana wrote:

> Howdy,
>
> I'm trying to use R to access Oracle 8i using the RODBC package On Linux
> Red Hat 7.3.
> Specs
> R version 1.51
> Driver: Easysoft ODBC - Oracle driver
> Driver Manager: unixODBC
>
> I get the following error when trying to executing RODBC commands. Can
> anybody give me pointers as to what I'm missing or doing wrong
>
>  > library(RODBC)
>  > channel <- ("DSNName")

That's not right.  It should be a call to odbcConnect.

>  > sqlQuery(channel,"select * from tableX")
> Error in odbcQuery(channel, query) : NAs in foreign function call (arg 1)
> In addition: Warning message:
> NAs introduced by coercion
>  > odbcTables(channel)
> Error in odbcTables(channel) : NAs in foreign function call (arg 1)
> In addition: Warning message:
> NAs introduced by coercion
>
> I am successfully able to run queries on the Oracle 8i database using
> Oracle SqlPlus and also using Easysoft's isql(which uses the odbc.ini file)
>
> The .odbc.ini file in the root folder looks as follows:
>
> [DSNName]
> Driver        = ORACLE
> Database        = ServerName
> User        = userName
> Password        = pwd
> METADATA_ID        = 0
> ENABLE_USER_CATALOG        = 1
> ENABLE_SYNONYMS        = 1

(Is that really correct?  You are supposed to fill in entries 2 to 4. Does
this work from a simple ODBC client?)

> Any help is very appreciated!!
>
> Vikram
>
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list