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

Description Usage Arguments Details Value

View source: R/lapplyquery.R

Description

Fetch queries using wildcard values given in vallist.

Usage

1
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/linking-data documentation built on Oct. 28, 2020, 2:41 a.m.