RMySQL dbWriteTable with field.types

shAnk

New Member
I have a data frame, called \[code\]df\[/code\], that looks like this:\[code\]dte, val2012-01-01, 23.23232012-01-02, 34.343\[/code\]The type on the columns is date and numeric. I would like to write this to a MySQL database using an already open connection. The connection works fine as I am able to query the db fine. I try to run the following:\[code\]dbWriteTable(con, name="table_name", value=http://stackoverflow.com/questions/8864174/df, field.types=list("date", "double(20,10)"))\[/code\]This generates the error:\[code\]Error in function (classes, fdef, mtable) : unable to find an inherited method for function "make.db.names", for signature "MySQLConnection", "NULL"\[/code\]If I do not specify a field.types, and run:\[code\]dbWriteTable(con, name="table_name", value=http://stackoverflow.com/questions/8864174/df)\[/code\]Then I get the error:\[code\]Error in mysqlExecStatement(conn, statement, ...) : RS-DBI driver: (could not run statement: BLOB/TEXT column 'dte' used in key specification without a key length)\[/code\]Can anyone shed some light on this?Thanks
 
Back
Top