dbListTables-OdbcConnection-method: List remote tables

Description Usage Arguments Details Value See Also Examples

Description

Returns the unquoted names of remote tables accessible through this connection. This should include views and temporary objects, but not all database backends (in particular RMariaDB and RMySQL) support this.

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

Usage

1
2
3
4
5
6
7
8
9
## S4 method for signature 'OdbcConnection'
dbListTables(
  conn,
  catalog_name = NULL,
  schema_name = NULL,
  table_name = NULL,
  table_type = NULL,
  ...
)

Arguments

conn

A DBIConnection object, as returned by dbConnect().

catalog_name

The name of the catalog to return, the default returns all catalogs.

schema_name

The name of the schema to return, the default returns all schemas.

table_name

The name of the table to return, the default returns all tables.

table_type

The type of the table to return, the default returns all table types.

...

Other parameters passed on to methods.

Details

% can be used as a wildcard in any of the search parameters to match 0 or more characters. _ can be used to match any single character.

Value

dbListTables() returns a character vector that enumerates all tables and views in the database. Tables added with dbWriteTable() are part of the list. As soon a table is removed from the database, it is also removed from the list of database tables.

The same applies to temporary tables if supported by the database.

The returned names are suitable for quoting with dbQuoteIdentifier(). An error is raised when calling this method for a closed or invalid connection.

See Also

The ODBC documentation on Pattern Value Arguments for further details on the supported syntax.

Examples

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

dbListTables(con)
dbWriteTable(con, "mtcars", mtcars)
dbListTables(con)

dbDisconnect(con)

Example output

character(0)
[1] "mtcars"

odbc documentation built on Dec. 11, 2021, 9:31 a.m.