powered by
This function will generate the DDL for a specific dbms and CDM version and then execute the DDL on a database.
executeDdl( connectionDetails, cdmVersion, cdmDatabaseSchema, executeDdl = TRUE, executePrimaryKey = TRUE, executeForeignKey = TRUE, ... )
Writes the fully specified DDLs, primary keys, foreign keys, and indices to a file and then executes on a database.
An object of class connectionDetails as created by the DatabaseConnector::createConnectionDetails function.
The version of the CDM you are creating, e.g. 5.3, 5.4
The schema of the CDM instance where the DDL will be run. For example, this would be "ohdsi.dbo" when testing on sql server.
Should the DDL be executed? TRUE or FALSE
Should the primary keys be added? TRUE or FALSE
Should the foreign keys be added? TRUE or FALSE
Other arguments passed on to DatabaseConnector::executeSql. (This allows the user to set the path to errorReportFile.)
if (FALSE) { executeDdl(connectionDetails = connectionDetails, cdmVersion = "5.4", cdmDatabaseSchema = "myCdm") }
Run the code above in your browser using DataLab