lapplyquery: SQL Helper Function: Apply Query multiple times, substituting...

View source: R/lapplyquery.R

lapplyqueryR Documentation

SQL Helper Function: Apply Query multiple times, substituting the '?' in the query

Description

Fetch queries using wildcard values given in vallist.

Usage

lapplyquery(qry, vallist, con = NULL)

Arguments

qry

Is SQL query created containing a '?' to indicate where vallist values should be placed. For JDBC is must be a character text, for ODBC qry can be an object created by DBI::dbSendQuery().

vallist

A list of values to replace the '?' in qry.

con

A DBI connection

Details

For ODBC the function dbBind and dbFetch are used. For JDBC dbBind doesn't work (at time of writing) so the replacement of '?' is performed before creating an SQL query object. When qry is a character object, the new line characters are ignored.

Value

A data frame of all results bound together (bound using rbind)


sustainablefarms/sflddata documentation built on April 19, 2022, 11:19 a.m.