Is there a simple way to use RSQLite
and sqldf
with more than 999 variables?
This question was raised also here. An answer on R-sig-DB
"The reason why this doesn't work seems to be SQLITE_MAX_VARIABLE_NUMBER in the sqlite source (in RSQLite) is currently set to 999."
Here is some sample code:
# works fine
widedf <- rnorm(2*998)
dim(widedf) <- c(2, 998)
f2 <- tempfile()
write.csv(widedf, f2, quote = FALSE)
f2 <- file(f2)
widedf <- sqldf("select * from f2",
dbname = tempfile(),
file.format = list(header = T, row.names = F))
# doesn't work
widedf <- rnorm(2*1000)
dim(widedf) <- c(2, 1000)
f1 <- tempfile()
write.csv(widedf, f1, quote = FALSE)
f1 <- file(f1)
widedf <- sqldf("select * from f1",
dbname = tempfile(),
file.format = list(header = T, row.names = F))
# Error in try({ :
# RS-DBI driver: (RS_sqlite_import: too many SQL variables)
What are the options in this situation?