Displaying 5 results from an estimated 5 matches for "dbgetpreparedquery".
2011 Jan 14
3
RSQLite - How to express(or save) a dataframe as an output?
...#39;')
drv <- dbDriver("SQLite", shared.cache = TRUE)
con <- dbConnect(drv, dbname = "temp.db",
loadable.extensions=TRUE)
on.exit(dbUnloadDriver(drv))
on.exit(dbDisconnect(con))
write('** Save output', '')
dbBeginTransaction(con)
dbGetPreparedQuery(con, "INSERT INTO output(df) VALUES (?)", data.frame(output))
dbCommit(con)
>
dbGetPreparedQuery(con,
"INSERT INTO output(df) VALUES (?)",
data.frame(output))
# --------------------------------------------------------...
2012 Mar 27
1
RSqlite UPDATE command problem
...UK 36
3 Canada 74
4 Australia 10
5 NewZealand 98
So, say, I want to change the value for NewZealand to '21' from '98'
I've tried something like this:
sql<-"UPDATE testtable SET vals=21 WHERE countries='NewZealand'"
dbBeginTransaction(con)
dbGetPreparedQuery(con,sql) <========== I get an error here
dbCommit(con)
using a different example for an INSERT command using a data frame 'data',
this construct is accepted:
dbGetPreparedQuery(con,sql,bind.data=data)
What do I need to do differently to use the UPDATE command?
Regards,
Tom
--
Tho...
2011 Feb 28
1
Data type problem when extract data from SQLite to R by using RSQLite
Hi there,
When I extract data from SQLite to R, the data types (or modes) of the
extracted data seems to be determined by the value of the first row.
Please see the following example.
When I put the missing values first, the column extracted is of the
mode character.
> str(dbGetQuery(sql.industry,
+ "select pya_var from annual_data3
+ order by
2010 Jul 09
2
Compress string memCompress/Decompress
Hello,
I would like to compress a long string (character vector), store the compressed string in the text field of a SQLite database (using RSQLite), and then load the text back into memory and decompress it back into the the original string. My character vector can be compressed considerably using standard gzip/bzip2 compression. In theory it should be much faster for me to compress/decompress
2010 Nov 15
5
How to Read a Large CSV into a Database with R
Hi, I'm working in R 2.11.1 x64 on Windows x86_64-pc-mingw32. I'm trying to
insert a very large CSV file into a SQLite database. I'm pretty new to
working with databases in R, so I apologize if I'm overlooking something
obvious here.
I'm trying to work with the American Community Survey data, which is two
1.3GB csv files. I have enough RAM to read one of them into memory,