dbGetQuery

0th

Percentile

Send query, retrieve results and then clear result set

dbGetQuery comes with a default implementation that calls dbSendQuery, then dbFetch, ensuring that the result is always free-d by dbClearResult.

Usage
dbGetQuery(conn, statement, ...)
Arguments
conn
A DBIConnection object, as produced by dbConnect.
statement
a character vector of length 1 containing SQL.
...
Other parameters passed on to methods.
Details

This function is for SELECT queries only. Some backends may support data manipulation statements through this function for compatibility reasons. However callers are strongly advised to use dbExecute for data manipulation statements.

Implementation notes

Subclasses should override this method only if they provide some sort of performance optimisation.

See Also

For updates: dbSendStatement and dbExecute.

Other DBIConnection generics: DBIConnection-class, dbDataType, dbDisconnect, dbExecute, dbExistsTable, dbGetException, dbGetInfo, dbIsValid, dbListFields, dbListResults, dbListTables, dbReadTable, dbRemoveTable, dbSendQuery, dbSendStatement

Aliases
  • dbGetQuery
Examples
library(DBI) con <- dbConnect(RSQLite::SQLite(), ":memory:") dbWriteTable(con, "mtcars", mtcars) dbGetQuery(con, "SELECT * FROM mtcars") dbDisconnect(con)
Documentation reproduced from package DBI, version 0.5-1, License: LGPL (>= 2)

Community examples

Looks like there are no examples yet.