[datatable-help] RODBC: able to connect to db but can't find table object

bbgtrack1 bbgtrack at gmail.com
Tue Jun 19 06:04:00 CEST 2012


Hi all, 
I am relative new to using r in conjunction with database. 
I am trying to connect from RStudio in Win7 to MySQL database in Linux
Ubuntu 12.04.1 via DSN. 

> library("RODBC")
> channel<-odbcConnect("test_mysql")
> odbcGetInfo(channel)
                DBMS_Name                  DBMS_Ver 
                  "MySQL" "5.5.24-0ubuntu0.12.04.1" 
          Driver_ODBC_Ver          Data_Source_Name 
                  "03.51"              "test_mysql" 
              Driver_Name                Driver_Ver 
            "myodbc5.dll"              "05.01.0011" 
                 ODBC_Ver               Server_Name 
             "03.80.0000" "***.***.*.** via TCP/IP" 
> sqlTables(channel)
[1] TABLE_CAT   TABLE_SCHEM TABLE_NAME  TABLE_TYPE  REMARKS    
<0 rows> (or 0-length row.names)
> sqlPrimaryKeys(channel,func,errors=FALSE,as.is=TRUE,catalog=NULL,schema=NULL)
Error in sqlPrimaryKeys(channel, func, errors = FALSE, as.is = TRUE, catalog
= NULL,  : 
  object 'func' not found

the connection seems to have gone through, and the table "func" exist and
non-empty,  in fact the database has 20 tables but it returned non, yet it
couldn't locate one and return no value from the table. Is there something
obvious here that I don't see? 

Can someone please advice. 

Thanks, 
Julie

--
View this message in context: http://r.789695.n4.nabble.com/RODBC-able-to-connect-to-db-but-can-t-find-table-object-tp4633794.html
Sent from the datatable-help mailing list archive at Nabble.com.


More information about the datatable-help mailing list