connect: Connect

Description Usage Arguments Value Examples

Description

Connect to the database. Uses the db_dsn, db_username and db_password environment variables. Use Sys.setenv() to set them.

Usage

1
connect(oracle = TRUE)

Arguments

oracle

Boolean to indicate whether to automatically generate the connect.string for use with Oracle. Otherwise, you can provide the connect string by doing Sys.setenv('a connection string')

Value

ODBC connection object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
Sys.setenv(db_driver = 'mydriver',
           db_host = 'myhost',
           db_port = 123,
           db_sid = 'myservicename',
           db_username = 'myuser',
           db_password = 'mypass')

# If using the Oracle method
ora.connect.string
conn <- connect(oracle = TRUE)

# Or if using the connection string method
Sys.setenv(connect.string = 'a connection string',
           db_username = 'myuser', db_password = 'mypass')

conn <- connect()

ndesmo/rquery documentation built on May 7, 2019, 9:43 p.m.