Returns if a table given by name exists in the database.

dbExistsTable(conn, name, ...)



A DBIConnection object, as returned by dbConnect().


A character string specifying a DBMS table name.


Other parameters passed on to methods.


dbExistsTable() returns a logical scalar, TRUE if the table or view specified by the name argument exists, FALSE otherwise. This includes temporary tables if supported by the database.

An error is raised when calling this method for a closed or invalid connection. An error is also raised if name cannot be processed with dbQuoteIdentifier() or if this results in a non-scalar.

Additional arguments

TBD: temporary = NA

This must be provided as named argument. See the "Specification" section for details on their usage.


The name argument is processed as follows, to support databases that allow non-syntactic names for their objects:

For all tables listed by dbListTables(), dbExistsTable() returns TRUE.

See also

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


con <- dbConnect(RSQLite::SQLite(), ":memory:") dbExistsTable(con, "iris")
#> [1] FALSE
dbWriteTable(con, "iris", iris) dbExistsTable(con, "iris")
#> [1] TRUE