Skip to contents

Write the DDL to a SQL file. The SQL will be rendered (parameters replaced) and translated to the target SQL dialect. By default the @cdmDatabaseSchema parameter is kept in the SQL file and needs to be replaced before execution.

Usage

writeOccurrenceDdl(
  targetDialect,
  gaiaVersion,
  outputfolder,
  cdmDatabaseSchema = "@cdmDatabaseSchema"
)

Arguments

targetDialect

The dialect of the target database. Choices are "oracle", "postgresql", "pdw", "redshift", "impala", "netezza", "bigquery", "sql server", "spark", "snowflake", "synapse"

outputfolder

The directory or folder where the SQL file should be saved.

cdmDatabaseSchema

The schema of the CDM instance where the DDL will be run. For example, this would be "ohdsi.dbo" when testing on sql server. Defaults to "@cdmDatabaseSchema"

cdmVersion

The version of the CDM you are creating, e.g. 5.3, 5.4