R: List remote tables

dbListTables,OdbcConnection-method {odbc} | R Documentation

## List remote tables

### 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.

### Usage

    ## 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

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

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

    dbDisconnect(con)

[Package odbc version 1.3.2 Index]