dbClearResult: Clear a result set

Description Usage Arguments Value Specification See Also Examples

Description

Frees all resources (local and remote) associated with a result set. In some cases (e.g., very large result sets) this can be a critical step to avoid exhausting resources (memory, file descriptors, etc.)

\Sexpr[results=rd,stage=render]{DBI:::methods_as_rd("dbClearResult")}

Usage

1

Arguments

res

An object inheriting from DBIResult.

...

Other arguments passed on to methods.

Value

dbClearResult() returns TRUE, invisibly, for result sets obtained from both dbSendQuery() and dbSendStatement(). An attempt to close an already closed result set issues a warning in both cases.

Specification

dbClearResult() frees all resources associated with retrieving the result of a query or update operation. The DBI backend can expect a call to dbClearResult() for each dbSendQuery() or dbSendStatement() call.

See Also

Other DBIResult generics: DBIResult-class, dbBind, dbColumnInfo, dbFetch, dbGetInfo, dbGetRowCount, dbGetRowsAffected, dbGetStatement, dbHasCompleted, dbIsReadOnly, dbIsValid, dbQuoteIdentifier, dbQuoteLiteral, dbQuoteString, dbUnquoteIdentifier

Examples

1
2
3
4
5
6
7
con <- dbConnect(RSQLite::SQLite(), ":memory:")

rs <- dbSendQuery(con, "SELECT 1")
print(dbFetch(rs))

dbClearResult(rs)
dbDisconnect(con)

DBI documentation built on May 2, 2018, 5:04 p.m.