| dbConnect-methods {RSQLite} | R Documentation |
These methods are straight-forward implementations of the corresponding generic functions.
SQLiteDriver, or
the character string "SQLite" or an SQLiteConnection.
SQLiteConnection object as produced by dbConnect.
dbname, which
should refer to a file name.
A connection between R/S-Plus and the embeddable SQLite server is established. Note that since the SQLite is embedded in R/S-Plus, connections are not too resource hungry.
SQLite connections only require the file name where the SQLite
database reside. For details see SQLite.
See the Database Interface definition document
DBI.pdf in the base directory of this package
or http://developer.r-project.org/db.
SQLite,
dbConnect,
dbSendQuery,
dbGetQuery,
fetch,
dbCommit,
dbGetInfo,
dbReadTable.
# create an SQLite instance and create one connection.
drv <- dbDriver("SQLite")
# open the connection using user, passsword, etc., as
con <- dbConnect(drv, dbname = "sqlite.db")
# Run an SQL statement by creating first a resultSet object
rs <- dbSendQuery(con, statement = paste(
"SELECT w.laser_id, w.wavelength, p.cut_off",
"FROM WL w, PURGE P",
"WHERE w.laser_id = p.laser_id",
"SORT BY w.laser_id")
# we now fetch records from the resultSet into a data.frame
data <- fetch(rs, n = -1) # extract all rows
dim(data)