get_data_tables: get_data_tables

View source: R/get_data_tables.R

get_data_tablesR Documentation

get_data_tables

Description

This function allows users to extract tables for which they have select permissions from Oracle.

Usage

get_data_tables(
  schema = NULL,
  data.dir = file.path(getwd(), "data"),
  tables = NULL,
  rownum = NULL,
  usepkg = "rodbc",
  fn.oracle.username = "_none_",
  fn.oracle.password = "_none_",
  fn.oracle.dsn = "_none_",
  checkOnly = FALSE,
  force.extract = FALSE,
  env = .GlobalEnv,
  fuzzyMatch = TRUE,
  quietly = TRUE
)

Arguments

schema

default is NULL. This is the schema you want to access a additional tables from.

data.dir

The default is your working directory. If you are hoping to load existing data, this folder should contain a data folder containing your rdata files. If you are extracting data, a data folder will be created under this folder. extracted files to go.

tables

The default value is NULL. This is a vector of table names you want to extract that exist in identified schema of the the database.

rownum

The default value is NULL. This is an integer that can be used to limit the number of records retrieved from the specified table(s). If it is left as NULL, all records retrieved. Otherwise, it will return the specified number of rows.

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.

fn.oracle.password

default is '_none_' This is your password for accessing oracle objects.

fn.oracle.dsn

default is '_none_' This is your dsn/ODBC identifier for accessing oracle objects.

checkOnly

default is FALSE This flag allows the function to be run such that it checks for the existence of the files, but doesn't load them.

force.extract

default is FALSE This flag forces a re-extraction of all of the tables (rather than loading previously extracted versions from data.dir)

env

This the the environment you want this function to work in. The default value is .GlobalEnv.

fuzzyMatch

default is TRUE. This allows source data tables to match with (generally) synonymous schema identifiers (i.e. MARFIS.==MARFISSCI.; RV.==GROUNDFISH.; ISDB.=OBSERVER.) Changing to False forces an exact match.

quietly

default is FALSE. If TRUE, no output messages will be shown.

Author(s)

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

See Also

Other dfo_extractions: make_oracle_cxn()


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