fn_guess_sql_where: Guess an SQL query with a WHERE clasue from a simple list of...

View source: R/odbc_utils.R

fn_guess_sql_whereR Documentation

Guess an SQL query with a WHERE clasue from a simple list of inputs, using all inputs to construct WHERE

Description

Guess an SQL query with a WHERE clasue from a simple list of inputs, using all inputs to construct WHERE

Usage

fn_guess_sql_where(entity_type, pk, inputs, alias = "")

Arguments

entity_type

Most often dh_feature or dh_properties. Indicates which table to retrieve data from. This will be the target table for the query constructed from user inputs input list

pk

Primary key column name, often hydroid or pid. See Readme for additional information or contact OWSPA Data Coordinatory if you do not know the appropriate primary key for the table of interest

inputs

contents of record to post in list(pid=X, propname='nom', propvalue, ...). The pk column may (optional) be one of the entries in this list and this should serve as the primary key ID that the user is interested in identifying. If a primary key is found, it is the only item added to the WHERE clause. Otherwise, all contents of inputs will be added into the WHERE clause constructed from this query

alias

assign an alias to a give table/view relation?

Value

A WHERE clasue to be added to an SQL query, perhaps generated via fn_guess_sql

Examples

NA

HARPgroup/hydro-tools documentation built on July 4, 2025, 11:05 a.m.