解决方案"/>
R连接mysql时,已列出所有表,错误Error in odbcTableExists(channel, sqtable) object 'wuliudata' not found解决方案
首先在R中连接数据库
> library(RODBC) > myconn <- odbcConnect("mysql_data",uid="wenrui",pwd="wenrui") > myconn RODBC Connection 1 Details:case=tolowerDSN=mysql_dataUID=wenruiPWD=******
列出所有的数据表
> sqlTables(myconn) TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS 1 wuliu wuliudata TABLE 2 wuliu wuliudata2 TABLE 3 wuliu wuliudatanew TABLE 4 wuliu wuliudatanew2 TABLE 5 wuliu wuliudatanew3 TABLE 6 wuliu wuliudataonly2 TABLE 7 wuliu wuliudataonly2_copy TABLE 8 wuliu wuliunew3 TABLE
连接表
> wuliudata <- sqlFetch(myconn,wuliunew3) Error in odbcTableExists(channel, sqtable) : object 'wuliunew3' not found
出现错误,好奇怪,这是为什么呢?
解决方案!!!
> wuliudata <- sqlFetch(myconn,"wuliunew3")>
给表加上双引号,就不会报错了
更多推荐
R连接mysql时,已列出所有表,错误Error in odbcTableExists(channel, sqtable) object 'wuliu
发布评论