db.search.path: Display or set the search path (i.e. default schemas) for a...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/db_conn-generic.R

Description

Allow the user to check and set the search path for the session that he connects to the database. The search path is a set of schema names separated by commas. These are the default schemas that the programme will search and save tables if a schema name is not given together with the table name in the format of "schema_name.table_name".

Usage

1
2
3

Arguments

conn.id

An integer, default is 1. The ID of the database connection.

set

A string, default is NULL. The default schema names separated by commas.

Value

When set is NULL, this function prints the current connected session's search path.

Author(s)

Author: Predictive Analytics Team at Pivotal Inc.

Maintainer: Frank McQuillan, Pivotal Inc. [email protected]

See Also

db.connect connects to database, and the parameter default.schemas can be used to set the search path when connecting.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 


## set up the database connection
## Assume that .port is port number and .dbname is the database name
cid <- db.connect(port = .port, dbname = .dbname, verbose = FALSE, default.schemas =
"public,madlib")

db.search.path()

db.search.path(set = "public,madlibtestdata")

db.disconnect(cid, verbose = FALSE)

## End(Not run)

PivotalR documentation built on May 30, 2017, 8:18 a.m.