make_oracle_cxn: make_oracle_cxn

View source: R/make_oracle_cxn.r

make_oracle_cxnR Documentation

make_oracle_cxn

Description

This function facilitates creating a connection to Oracle, and allows connection via RODBC or ROracle, depending on the value of usepkg.

Usage

make_oracle_cxn(
  usepkg = "rodbc",
  fn.oracle.username = "_none_",
  fn.oracle.password = "_none_",
  fn.oracle.dsn = "_none_",
  quietly = FALSE
)

Arguments

usepkg

default is 'rodbc'. This indicates whether the connection to Oracle should use 'rodbc' or 'roracle' to connect. rodbc is slightly easier to setup, but roracle will extract data ~ 5x faster.

fn.oracle.username

default is '_none_' This is your username for accessing oracle objects. If you have a value for oracle.username stored in your environment (e.g. from an rprofile file), this can be left out and that value will be used. If a value for this is provided, it will take priority over your existing value.

fn.oracle.password

default is '_none_' This is your password for accessing oracle objects. If you have a value for oracle.password stored in your environment (e.g. from an rprofile file), this can be left out and that value will be used. If a value for this is provided, it will take priority over your existing value.

fn.oracle.dsn

default is '_none_' This is your dsn/ODBC identifier for accessing oracle objects. If you have a value for oracle.dsn stored in your environment (e.g. from an rprofile file), this can be left and that value will be used. If a value for this is provided, it will take priority over your existing value.

quietly

default is FALSE This indicates whether or not status messages should be shown.

Note

This function temporarily changes the system values for "TZ" and "ORA_SDTZ" to "GMT" to ensure that dates and times extracted from the various databases remain correct. It does this by running Sys.setenv(TZ = "GMT") and Sys.setenv(ORA_SDTZ = "GMT"). Once a connection is established (or failes to be established), it restores the values that previously existed.

Author(s)

Mike McMahon, Mike.McMahon@dfo-mpo.gc.ca

See Also

Other dfo_extractions: get_data_tables()


Maritimes/Mar.utils documentation built on Feb. 12, 2024, 11:38 p.m.