quickSQL {RSQLite}R Documentation

Quick SQL Execution

Description

Simplifies queries by submitting an SQL command and fetching its output in one function

Usage

quickSQL(con, statement, ...)

Arguments

con an open dbConnection object.
statement an SQL statement as a character vector.
... any additional arguments specific to the database engine may be specified.

Details

This function simply calls dbExecStatement followed by fetch.

Value

a data.frame in the case of a SELECT-like statement, or NULL otherwise.

Bugs:

Perhaps this function should be named dbQuery or dbImmediate?

References

See the Omega Project for Statistical Computing at http://www.omegahat.org for more details on the R/S database interface.

See Also

On database managers:

dbManager SQLite load unload

On connections, SQL statements and resultSets:

dbExecStatement dbExec fetch quickSQL

On transaction management:

commit rollback

On meta-data:

describe getVersion getDatabases getTables getFields getCurrentDatabase getTableIndices getException getStatement hasCompleted getRowCount getAffectedRows getNullOk getInfo

Examples

# The following extract all the tables in the current database

mgr <- dbManager("SQLite")
con <- dbConnect(mgr)
quickSQL(con, "show tables")


[Package Contents]