Learn R Programming

DBI (version 0.5-1)

dbIsValid: Is this DBMS object still valid?

Description

This generic tests whether a database object is still valid (i.e. it hasn't been disconnected or cleared).

Usage

dbIsValid(dbObj, ...)

Arguments

dbObj
An object inheriting from DBIObject, i.e. DBIDriver, DBIConnection, or a DBIResult
...
Other arguments to methods.

Value

a logical of length 1

See Also

Other DBIDriver generics: DBIDriver-class, dbConnect, dbDataType, dbDriver, dbGetInfo, dbListConnections

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

Other DBIResult generics: DBIResult-class, SQL, dbBind, dbClearResult, dbColumnInfo, dbFetch, dbGetInfo, dbGetRowCount, dbGetRowsAffected, dbGetStatement, dbHasCompleted

Examples

Run this code
dbIsValid(RSQLite::SQLite())

con <- dbConnect(RSQLite::SQLite(), ":memory:")
dbIsValid(con)

rs <- dbSendQuery(con, "SELECT 1")
dbIsValid(rs)

dbClearResult(rs)
dbIsValid(rs)

dbDisconnect(con)
dbIsValid(con)

Run the code above in your browser using DataLab