Append cohort data from multiple cohort tables(s)
Source:R/AppendCohortTables.R
appendCohortTables.Rd
Usage
appendCohortTables(
connectionDetails = NULL,
connection = NULL,
sourceTables,
targetCohortDatabaseSchema = NULL,
targetCohortTable,
isTempTable = FALSE,
tempEmulationSchema = getOption("sqlRenderTempEmulationSchema")
)
Arguments
- connectionDetails
An object of type
connectionDetails
as created using thecreateConnectionDetails
function in the DatabaseConnector package. Can be left NULL ifconnection
is provided.- connection
An object of type
connection
as created using theconnect
function in the DatabaseConnector package. Can be left NULL ifconnectionDetails
is provided, in which case a new connection will be opened at the start of the function, and closed when the function finishes.- sourceTables
A data.frame object with the columns sourceCohortDatabaseSchema, sourceCohortTableName.
- targetCohortDatabaseSchema
Schema name where your target cohort tables reside. Note that for SQL Server, this should include both the database and schema name, for example 'scratch.dbo'.
- targetCohortTable
The name of the target cohort table.
- isTempTable
Is the output a temp table. If yes, a new temp table is created. This will required an active connection. Any old temp table is dropped and replaced.
- tempEmulationSchema
Some database platforms like Oracle and Impala do not truly support temp tables. To emulate temp tables, provide a schema with write privileges where temp tables can be created.