| dbSendQuery-methods {RSQLite} | R Documentation |
These are the primary methods for interacting with a database via SQL queries.
SQLiteConnection object.SQLiteResult object.
See the Database Interface definition document
DBI.pdf in the base directory of this package
or http://stat.bell-labs.com/RS-DBI.
SQLite,
dbDriver,
dbConnect,
fetch,
dbCommit,
dbGetInfo,
dbReadTable.
con <- dbConnect(SQLite(), ":memory:")
data(USArrests)
dbWriteTable(con, "arrests", USArrests)
res <- dbSendQuery(con, "SELECT * from arrests")
data <- fetch(res, n = 2)
data
dbClearResult(res)
dbGetQuery(con, "SELECT * from arrests limit 3")
tryCatch(dbGetQuery(con, "SELECT * FROM tableDoesNotExist"),
error=function(e) { print("caught") })
dbGetException(con)