0

Trying to use dbWriteTable with the RSQLite driver results in the following error:

In value[[3L]](cond) :
  RAW() can only be applied to a 'raw', not a 'character'  

My R Script:

Con <- dbConnect(SQLite(), dbname="fake.db")
dbWriteTable(Con, "tabeltest", myData.Frame)
dbWriteTable(Con, "anotherTable", myData.Frame)
dbWriteTable(Con, "lastTable", myData.Frame)

I am trying to re-create this bug with a smaller data.frame, but cannot... (which makes this much more difficult to triage)

If I change Con <- dbConnect(SQLite(), dbname="fake.db") to Con <- dbConnect(SQLite(force.reload=T), dbname="fake.db") I get:

In sqliteInitDriver(max.con, fetch.default.rec, force.reload, shared.cache) :RS-DBI driver warning: (mgr->drvData was not freed (some memory leaked))

I am on Windows 7 running R 3.02

Joshua Ulrich
  • 173,410
  • 32
  • 338
  • 418
JayCo
  • 784
  • 7
  • 22

1 Answers1

1

It seems that RMySQL will not write to a database if a table has a column of all NULL values in multiple tables.

I was able to successfully write to the tables by removing the null columns.

I have made this a community wiki so we can 1) triage the problem 2) develop a data.frame that can recreate the problem, and 3) issue a pull request to fix the problem.

JayCo
  • 784
  • 7
  • 22