---
title: "DDL Settings"
canonical: "https://docs.vaultspeed.com/space/VPD/3013312538/DDL%20Settings"
format: markdown
---
In the **DDL Settings** menu, custom DDL Settings (i.e. modifiers to the create table statement) can be predefined.

> 📝 This page describes the basic functionalities of the screen.  For more details and examples on DDL settings, please visit: [https://vaultspeed.atlassian.net/wiki/spaces/VPD/pages/3013017629](https://vaultspeed.atlassian.net/wiki/spaces/VPD/pages/3013017629)

To take a look at the DDL settings, Navigate to the **DDL/ETL Generation **Menu and click on **DDL Settings**.

![image](media://d6fa0df5-31f7-4867-bb78-d868b0e72b5b)

# DDL Settings List

On the DDL Settings List, you see all the settings that are already created.  Notice that VaultSpeed already has some settings created by default (depending on your database type). 

> ℹ️ For postgres VaultSpeed automatically adds a ‘CASCADE’ to the drop statements.  If you have objects dependent of the objects created by VaultSpeed, make sure to remove the ‘CASCADE’ from the layers you don’t want to have it.

To Create a new set of DDL Settings, click the ‘+ DDL Preset’ button.  In the popup screen, give the setting a name and select a database type:

![image](media://3f01b376-62b0-4165-98a8-e8ed4f28614f)

The screen now opens up more, and several database parameters can be chosen here, either by turning the option on or off, or by entering a custom option. On the bottom of the screen, an example of a CREATE TABLE Statement is shown, reflecting the options that were set:

![image](media://c1bd0deb-d0b4-4029-8c69-dac2a8f47412)

![image](media://21662745-3673-4c9e-98ee-bf7957043761)

On the custom statements, you have options for:

- Custom create statement
  - This is a statement that will be added between the ‘CREATE’ and ‘TABLE’ keywords of your command.
- Custom create table options
  - This is a statement that will be added at the end of the create statement
- Custom drop statement (only for full generations, with the parameter ‘DDL_DROP’ set to 'Y')
  - This statement will be added between the ‘DROP’ and ‘TABLE’ keywords of the drop statement
- Custom drop table option
  - This statement will be added at the end of the drop statement.

![image](media://5bc1bf12-1c7e-49c4-9eef-bc7d47fad3ac)

When you have set everything you wanted to set, click the ‘Create’ button to save the settings.

To modify an already saved setting, use the Actions menu options at the end of each record to ‘Edit’ or ‘Delete’ the Preset.

# Apply DDL Settings

Settings will only be used after they are applied.

In the **Apply DDL Settings** submenu, the settings can be applied.

![image](media://528fc425-5c56-4a27-af8b-d53a78264841)

In the drop-down boxes, select:

- Layer: the loading layer where you want to apply the setting to. The different layers are:
  - Business_vault_layer: The loading logic for all business vault objects (except the ones created through VaultSpeed studio)
  - cdc_layer: The loading logic for all change data capture objects
  - delta_firewall_layer: The loading logic for the Delta Firewall Views
  - delta_layer: The loading logic for the Delta Tables
  - extraction_layer: The loading logic for the Extraction Layer
  - flow_management_control_layer: The loading logic on the FMC objects
  - foundation_layer: The loading logic for the Raw Data Vault Objects
  - initial_load_layer: The loading logic for the initial load objects
  - metadata_layer: The loading logic for the metadata objects per source
  - staging_layer: The loading logic for the staging layer
- Settings Preset: one of the settings you created in the previous step
- Data Vault: the data vault on which you want to apply the setting
- Source: The source where you want to apply the settings to.

> ℹ️ The Business vault or foundation layer are no longer distinct per source, so you can select the different object types here. (see below)

Click the ‘Apply DDL Preset’ button to apply the setting to the selected layer/objects. The applied setting will now appear in the list below.

![image](media://d7238e7e-4a3f-4bc3-82a9-a10f09e17894)

> ⚠️ Only one preset can be active at the same time.  If there was a DDL setting applied before, it will be overwritten by the new one.

Selecting the **Foundation layer** or **Business Vault Layer** will replace the source dropdown with an Object Type one. It can be left empty to apply a setting to all objects or to a specific type. This can be mixed, so for example, you can set a certain setting for all types and a different one for only the HUBs or PITs.

![image](media://b01e8a66-e6c8-496d-84b6-9bdb242a7245)

# Using Attributes in the Settings

For certain settings, you might want to reference certain attributes, such as when configuring partitioning or distribution. This can be done by entering attribute types in the settings, for example:

```
DISTRIBUTED BY OBJECT_H_KEY
```

These types can be found in the VaultSpeed Studio or in the Data Vaults → Overview → Data Vault menu by clicking on one of your objects to see the details of the attributes in that table.

The most commonly used attribute types in the Raw Data Vault are:

|  |  |
| --- | --- |
| <u>**COLUMN_TYPE**</u> | <u>**COMMENT**</u> |
| OBJECT_H_KEY | Hash Key of an object |
| LOAD_TIMESTAMP | Load Timestamp |
| LOAD_CYCLE_ID | Load Cycle Id |
| LOAD_END_TIMESTAMP | Load End Timestamp |
| BUSINESS_KEY | Business Key |
| CONCAT_BUSINESS_KEY | Concatenated Business Key |
| SOURCE_SYSTEM_NAME | The Record source name used in multi primary hubs |
| TRANS_TIMESTAMP | Transaction Timestamp |
| FOREIGN_KEY | Foreign Key |
| OBJECT_F_H_KEY | Hash Key of the objects you are referring to (used in link tables) |
| OBJECT_P_H_KEY | Hash Key of the objects you are referring from (used in link tables) |
| SUB_SEQUENCE_NUMBER | Sub Sequence Number |
| RECORD_SOURCE | the record source attribute (only available if the parameter to add this attribute is enabled) |

example:

![image](media://d3e824aa-b642-4ceb-a20f-56f835ca8eb4)

This will generate the following code (when applied to the HUB tables)

![image](media://a97546dd-32cc-419a-97bf-c1d0ad5217a3)