Skip to content
Prev 207430 / 398506 Next

RMySQL Append data.frame to table

I have a data.frame obj with 5 columns whose colnames match the fields 
in my "contact" table. The only other field my MySQL table has is an id 
field which is the PK and is set to auto increment.

I'd like to load this data.frame using something like:
dbWriteTable(con, "contact", dat, append=TRUE)

However, I get this error:
Error in mysqlExecStatement(conn, statement, ...) :
   RS-DBI driver: (could not run statement: Unknown column 'row_names' 
in 'field list')
[1] FALSE
Warning message:
In mysqlWriteTable(conn, name, value, ...) : could not load data into table

Can anyone shed light on this error, or how I might bulk load this data 
using RMySQL?

Cheers,
Nathan