genericQuery: Execute database query and returns fetched rows.

View source: R/initSENDFunctions.R

genericQueryR Documentation

Execute database query and returns fetched rows.

Description

The function executes a SQL select statements in the database and returns the fetched set of rows as a data.table.

Usage

genericQuery(dbToken, queryString, queryParams = NULL)

Arguments

dbToken

Mandatory
Token for the open database connection (see initEnvironment).

queryString

Mandatory, character.
The select statement to execute

queryParams

Optional, character.
A variable with values for bind variable referenced in the where clause of the select statement

Value

Data.table with the set of fetched rows

Examples


## Not run: 
genericQuery(dbToken,
             'select studyid, tsseq, tsgrpid, tsparmcd, tsval from ts')
genericQuery(dbToken,
             'select studyid, tsval from ts where tsprmcd = "SDESIGN" and studyid in (:1)',
             list("1234546","222333","444555"))

## End(Not run)

sendigR documentation built on Aug. 18, 2022, 9:07 a.m.