[R] RMySQL Append data.frame to table

Orvalho Augusto orvaquim at gmail.com
Mon Jan 25 09:50:39 CET 2010


May be because by default dbWriteTable has row.names = T.

So try with row.names = F.

Good Luck

Caveman


On Mon, Jan 25, 2010 at 8:57 AM, Nathan S. Watson-Haigh
<nathan.watson-haigh at csiro.au> wrote:
> 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
>
> --
> --------------------------------------------------------
> Dr. Nathan S. Watson-Haigh
> OCE Post Doctoral Fellow
> CSIRO Livestock Industries
> University Drive
> Townsville, QLD 4810
> Australia
>
> Tel: +61 (0)7 4753 8548
> Fax: +61 (0)7 4753 8600
> Web: http://www.csiro.au/people/Nathan.Watson-Haigh.html
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
OpenSource Software Consultant
CENFOSS (www.cenfoss.co.mz)
SP Tech (www.sptech.co.mz)
email: orvaquim at cenfoss.co.mz
cell: +258828810980



More information about the R-help mailing list