BATsqlQuery64: BATsqlQuery64

View source: R/BATsqlQuery64.R

BATsqlQuery64R Documentation

BATsqlQuery64

Description

Wrapper function for RODBC:sqlQuery to select batches of specific records from tables or views

Usage

BATsqlQuery64(
  ids,
  table = "PLOT_OWNER",
  field = "CN",
  idtag = "<I>",
  ttag = "<T>",
  ftag = "<F>",
  query = "SELECT * FROM FS_NWOS.<T> WHERE <F> IN ('<I>')"
)

Arguments

ids

is a character vector containing NWOS CNs to be queried.

table

is a character string containing the name of the table to be queried.

field

is a character string containing the name of the field in the desired table containing the desired CNs.

idtag

is a character string containing the name of the tag in the query template that refers to the ids (for use with custom queries).

ttag

is a character string containing the name of the tag in the query template that refers to the table (for use with custom queries).

ftag

is a character string containing the name of the tag in the query template that refers to the field (for use with custom queries).

query

is a character string containing text of a custom SQL query, containing the values of idtag, ttag, and ftag.

Details

This function must be run on a machine with an ODBC connection (32-bit) to the USFS FIA production database through a user with read permissions.

Value

a dataframe containing the DB return

Examples

BATsqlQuery64(ids=c('SAM0001','SAM0002',table=c('SAMPLE'))


familyforestresearchcenter/nwos documentation built on April 12, 2025, 11:54 a.m.