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

Description Usage Arguments Examples

View source: R/Id.R

Description

Objects of class Id have a single slot name, which is a named 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

1

Arguments

...

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Identifies a table in a specific schema:
Id(schema = "dbo", table = "Customer")

# Identifies a table in a specific cluster, catalog, and schema:
Id(cluster = "mycluster", catalog = "mycatalog", schema = "myschema", table = "mytable")

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

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

## End(Not run)

DBI documentation built on Dec. 20, 2021, 9:07 a.m.