Rmysql字段列表中的未知列 [英] Unknown column in field list error Rmysql

查看:280
本文介绍了Rmysql字段列表中的未知列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用

dbWriteTable(con, name='db_all', df, overwrite=T, row.names=F) 

使用RMySQL成功地连接到MySQL. 现在,我有另一个具有类似结构的数据框,并尝试使用

sucessfully to MySQL using RMySQL. Now I have a second data frame which has a similar structure and try to use

dbWriteTable(con,name='db_all',df1,append=T,row.names=F,overwrite=F)

这给了我

.local(conn,statement,...)中的错误: 无法运行语句:字段列表"中的未知列"zzz">

Error in .local(conn, statement, ...) : could not run statement: Unknown column 'zzz' in 'field list'>

在我的SQL表中,我还没有该列名,并且希望我的append = T将在我的SQL表中添加此列,但显然没有.

In my SQL table I don't have that column name yet and would expect my append=T will add this column in my SQL table, which apparently it does not.

推荐答案

未知列的名称是什么?如果是"row_names",则需要在dbWriteTable()中设置参数row.names = FALSE.否则,它将尝试在插入语句的数据框中包含行名.

What is the name of the unknown column? If it is "row_names" then you need to set the parameter row.names = FALSE in dbWriteTable(). Otherwise, it tries to include the row names in your data frame in the insert statement.

这篇关于Rmysql字段列表中的未知列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆