Skip to contents

This function returns a listing of tables accessible to the connected user. The expectation is that this is a relatively thin wrapper around the ODBC SQLTables function call, albeit returning a subset of the fields.

Usage

odbcConnectionTables(conn, name, ...)

# S4 method for OdbcConnection,Id
odbcConnectionTables(conn, name, table_type = NULL, exact = FALSE)

# S4 method for OdbcConnection,character
odbcConnectionTables(
  conn,
  name,
  catalog_name = NULL,
  schema_name = NULL,
  table_type = NULL,
  exact = FALSE
)

# S4 method for OdbcConnection,ANY
odbcConnectionTables(
  conn,
  name = NULL,
  catalog_name = NULL,
  schema_name = NULL,
  table_type = NULL,
  exact = FALSE
)

# S4 method for OdbcConnection,SQL
odbcConnectionTables(conn, name, table_type = NULL, exact = FALSE)

Arguments

conn

OdbcConnection

name, catalog_name, schema_name

Catalog, schema, and table identifiers. By default, are interpreted as a ODBC search pattern where _ and % are wild cards. Set exact = TRUE to match _ exactly.

...

additional parameters to methods

table_type

List tables of this type, for example 'VIEW'. See odbcConnectionTableTypes for a listing of available table types for your connection.

exact

Set to TRUE to escape _ in identifier names so that it matches exactly, rather than matching any single character. % always matches any number of characters as this is unlikely to appear in a table name.

Value

data.frame with columns

  • table_catalog

  • table_schema

  • table_name

  • table_remarks

Details

It is important to note that, similar to the ODBC/API call, this method also accomodates pattern-value arguments for the catalog, schema, and table name arguments.

If extending this method, be aware that package:odbc internally uses this method to satisfy both DBI::dbListTables and DBI::dbExistsTable methods. ( The former also advertises pattern value arguments )

See also

The ODBC documentation on SQLTables for further details.