JayCo
JayCo

Reputation: 824

Error in RSQLite

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

Upvotes: 0

Views: 880

Answers (1)

JayCo
JayCo

Reputation: 824

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.

Upvotes: 1

Related Questions