objectNameFixEM: Format input for database schema/object names.

Description Usage Arguments Details Value Examples

View source: R/AmerAssocIndividInvestorsAAII.R

Description

This is a near copy of the R CRAN package rpostgis function dbTableNameFix.

Usage

1
2
3
4
5
6
7
8
9
objectNameFixEM(
  connName,
  o.nm,
  as.identifier = TRUE,
  dbQuote = "Identifier",
  env,
  display = TRUE,
  exec = TRUE
)

Arguments

connName

String. Default is "connEM". Contains the name of the variable that contains the name of the "connection" in the environment "env". where a dummy connection will be used.

o.nm

Object name string, length 1-2.

as.identifier

Boolean whether to return (schema,table) name as database sanitized identifiers (TRUE) or as regular character (FALSE)

dbQuote

String. Only used when "as.identifier = TRUE". Default is "Identifier". Alternately, this value can be "Literal."

env

Environment. Default is the .Global environment. This is the environment to return the connection object "connEM".

display

Logical. Whether to display the query (defaults to TRUE).

exec

Logical. Whether to execute the query (defaults to TRUE).

Details

Internal rpostgis function to return common (length = 2) schema and table name vector from various table and schema + table name inputs.

Value

character vector of length 2. Each character element is in (escaped) double-quotes when as.identifier = TRUE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
name <- c("schema","table")
objectNameFixEM(o.nm = name)

#current search path schema is added to single-length character object (if only table is given)
name<-"table"
objectNameFixEM(o.nm = name)

#schema or table names with double quotes should be given exactly as they are
(make sure to wrap in single quotes in R):
name <- c('sch"ema','"table"')
objectNameFixEM(o.nm = name)

## End(Not run)

AndreMikulec/econModel documentation built on June 30, 2021, 9:48 a.m.