tdConn: tdConn

Description Usage Arguments Details Value See Also Examples

Description

Checks for a connection to the Teradata server. If none exists, tries to establish one. If no JDBC connection is provided (tdConn), then a connection is attempted using the user, and password provided.

Usage

1
2
tdConn(username = getOption("tdPassword"), password = NULL,
  addr = getOption("tdAddr"), db = "", classPath = NULL, conn = NULL)

Arguments

username

Connection user name. By default, will try to search for a global environment variable called tdPassword. If found, will use those credentials.

password

Connection password. By default, will try to search for a global environment variable called tdPassword. If found, will use those credentials.

addr

String containing address of database to connect to. By default, will try to search for a global environment variable called tdAddr. If found, will use those credentials.

db

Name of database to connect to.

classPath

The location of the JDBC drivers. By default, will use the drivers included in the package.

conn

DBIConnection object with established connection to the RDMBS. Only used internally to check connection and establish a connection if none exists.

Details

If desired, you can define your username and password in the .Rprofile file using the command options(tdPassword = c(<username>="<password>")), which will then automatically assign the password in the background each time R is started. This then allows you to connect without having to enter your username and password manually each time you connect.

The JDBC driver included uses the v15.10.00.33 release (12 Jan 2016) tdgssconfig.jar and terajdbc4.jar drivers.

Value

A RJDBC connection object is returned.

See Also

td for Teradata queries, tdDisk for disk usage, tdSpool for spool usage, tdCpu for CPU usage, and tdJoin for joining tables.

Examples

1
2
3
4
5
6
7
8
9
## NOT RUN ##
## Connect to default data warehouse and data base
# conn = tdConn()

## Connect to data warehouse using different credentials and data base
# conn = tdConn(<username>, <password>, db='ADM_AMR')

## Connect to different data warehouse than default
# conn = tdConn(<username>, <password>, addr="jdbc:teradata://new.warehouse.com")

tranlm/tdR documentation built on May 31, 2019, 7:45 p.m.