usa_query_database: Wrapper to make a query from a sql file and get the data from...

View source: R/utils-usa_query_database.R

usa_query_databaseR Documentation

Wrapper to make a query from a sql file and get the data from a database using RODBC

Description

Wrapper to make a query from a sql file and get the data from a database using RODBC

Usage

usa_query_database(
  queryFilename,
  db,
  uid,
  pw = "",
  sp = " ",
  start = " ",
  end = " ",
  asis = FALSE
)

Arguments

queryFilename

The filename of the sql query to read in.

db

The name of your database connection.

uid

Your user ID.

pw

The password for the database connection. If omitted, RODBC will prompt you for a password and will mask it. If entered, it will be visible and unsecure.

sp

The species scientific name to extract from the database.

start

The start year.

end

The end year.

ais

A logical, specifying whether or not to convert columns, as in read.table.

Details

Calls RODBC functions. The function first opens an ODBC connection and, using sql, extracts data from the db.

Author(s)

Kelli F. Johnson

See Also

sqlQuery


pacific-hake/hake-assessment documentation built on Jan. 14, 2025, 9:12 p.m.