Id-class {DBI}R Documentation

Refer to a table nested in a hierarchy (e.g. within a schema)

Description

Objects of class Id have a single slot name, which is a character vector. The dbQuoteIdentifier() method converts Id objects to strings. Support for Id objects depends on the database backend.

They can be used in the following methods as name or table argument:

Objects of this class are also returned from dbListObjects().

Usage

Id(...)

Arguments

...

Components of the hierarchy, e.g. cluster, catalog, schema, or table, depending on the database backend. For more on these concepts, see https://stackoverflow.com/questions/7022755/

Examples

# Identifies a table in a specific schema:
Id("dbo", "Customer")
# You can name the components if you want, but it's not needed
Id(table = "Customer", schema = "dbo")

# Create a SQL expression for an identifier:
dbQuoteIdentifier(ANSI(), Id("nycflights13", "flights"))

# Write a table in a specific schema:
## Not run: 
dbWriteTable(con, Id("myschema", "mytable"), data.frame(a = 1))

## End(Not run)

[Package DBI version 1.2.2 Index]