dbExistsTable | R Documentation |
Returns if a table given by name exists in the database.
\Sexpr[results=rd,stage=render]{DBI:::methods_as_rd("dbExistsTable")}dbExistsTable(conn, name, ...)
conn |
A DBIConnection object, as returned by
|
name |
The table name, passed on to
|
... |
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.
The name
argument is processed as follows,
to support databases that allow non-syntactic names for their objects:
If an unquoted table name as string: dbExistsTable()
will do the
quoting,
perhaps by calling dbQuoteIdentifier(conn, x = name)
If the result of a call to dbQuoteIdentifier()
: no more quoting is done
For all tables listed by dbListTables()
, dbExistsTable()
returns TRUE
.
Other DBIConnection generics:
DBIConnection-class
,
dbAppendTable()
,
dbAppendTableArrow()
,
dbCreateTable()
,
dbCreateTableArrow()
,
dbDataType()
,
dbDisconnect()
,
dbExecute()
,
dbGetException()
,
dbGetInfo()
,
dbGetQuery()
,
dbGetQueryArrow()
,
dbIsReadOnly()
,
dbIsValid()
,
dbListFields()
,
dbListObjects()
,
dbListResults()
,
dbListTables()
,
dbQuoteIdentifier()
,
dbReadTable()
,
dbReadTableArrow()
,
dbRemoveTable()
,
dbSendQuery()
,
dbSendQueryArrow()
,
dbSendStatement()
,
dbUnquoteIdentifier()
,
dbWriteTable()
,
dbWriteTableArrow()
con <- dbConnect(RSQLite::SQLite(), ":memory:")
dbExistsTable(con, "iris")
dbWriteTable(con, "iris", iris)
dbExistsTable(con, "iris")
dbDisconnect(con)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.