---
title: "Data Type Settings"
canonical: "https://docs.vaultspeed.com/space/VPD/3010723931/Data%20Type%20Settings"
format: markdown
---
**Table of Contents**

> Macro (toc)

## Introduction to Data Type Settings in VaultSpeed

The Data Type Settings screen allows you to add custom data types, change the default data type mappings and lets you set your default values for creating the Unknown and Null records.

VaultSpeed will automatically gather all existing data types of your target technology and, if needed, apply a data type mapping between the data types of the source technology and the target technology.  You can of course change this if you would like to have some other data type mappings.

On this page, there are 3 submenus :

1. [Types](https://vaultspeed.atlassian.net/wiki/spaces/VPD/pages/3128853974) in order to change data type settings or add data types.
2. [Type Mappings](https://vaultspeed.atlassian.net/wiki/spaces/VPD/pages/3128853974) in order to map data types between sources and data vaults.
3. [Special Values](https://vaultspeed.atlassian.net/wiki/spaces/VPD/pages/3128853974) in order to define the replacement values for Unknown or Null Values for every data type.

### Types: Managing and Customizing Data Types

In the** Types** submenu new target data types can be defined, or existing ones can be changed. 

The following data is needed in order to define a target data type :

- **Data Type**: Name of the Target Data Type
- **Max. Data Length**: the Maximum Length of a Field with this Data Type.
- **Has Length**: Do you have to specify a Length for this Data Type or not?
- **Has Scale**: Do you have to specify a Scale for this Data Type or not?
- **Data Type Subgroup**: Data Type classification, used for determining Formats and Casting.

You can use the ‘+ Data Type’ button to add a new data type that VaultSpeed doesn’t know yet (usually this is when you have custom-defined data types on your target database).

Fill in all the required fields (listed above) and also fill in a replacement null and replacement unknown value for it.

![image](media://780a6228-c22f-4f43-9b99-02364aab1f9b)


For the data types that are already defined, you can use the ‘Edit’ action menu in order to changes its attributes and click to ‘Save All’ to save your changes.

![image](media://27cdf256-0431-428b-8c66-445e480bded4)

### Type Mappings: Mapping Data Types between Sources and Data Vaults

> ⚠️ **Warning: **Changes to Global Data Type Mappings Affecting All Projects

> ℹ️ **Important Notice: **Attention Users:

**Global Data Type Mappings:**

- It has come to our attention that data type mappings are currently managed at a global account level, affecting all projects, Data Vaults, and Data Vault releases within the account. This means that changes made to data type mappings will globally impact all Data Vault versions.

**Why This Matters:**

- Due to this global approach, alterations in data type mappings can lead to unintended consequences for your projects, such as changes in column sizes, as observed in recent Data Vault releases, attributed to modifications at the account level.

**Transparency and Future Improvements:**

- We acknowledge the need for increased transparency and control over data type mappings. We are actively working on enhancements to address this issue and provide you with tools for managing data type mappings at a more granular level, tailored to your projects and Data Vault versions.

**Recommended Action:**

- Until these enhancements are implemented, we strongly advise you to exercise caution when making changes to data type mappings. Verify that any modifications align with the requirements of all projects and Data Vault versions within your account, as they will have a global impact.

**Additional Information:** Under "Type Mappings", you can modify existing mappings between source and target data types. The initial mapping is based on the SQL data type obtained from the JDBC Driver.

**Details Required for Target Data Type Mapping:**

To accurately define a Target Data Type Mapping, ensure you have the following specifics:

- **Data Type Target:** Name the Target Data Type you are defining.
- **Data Length Target:** Optionally, the Data Length on the Target can be left empty. Example:
  - **Usage**:
    - `-1`: Sets all lengths as (MAX) in (SQLServer/AzureDwh/Synapse).
    - `coalesce(2*x, -1)`: Doubles the length for attributes with specified length and sets it to (max) for those without.
  - **Setting Basis**:
    - Set it according to the Source Length (e.g., 2*x means twice the Source Length).
  - **Default Scaling for Char and VarChar Fields**:
    - By default, Char and VarChar Fields are scaled by the Char Length Scaling Parameter. (VARCHAR will always be set to Max. Length for PostgreSQL, e.g., no length.)
- **Data Precision Target:** Can be left empty or based on Source Precision.
- **Data Scale Target:** Can be left empty or based on Source Scale.
- **Special Values:**
  - *Unknown Value*: Utilized for missing references.
  - *Null Value*: Substitutes empty values (empty string and/or null based on the EMPTY_STRING_IS_NULL parameter) in Key Fields.

> ℹ️ **Important Notice: **Make sure to integrate these configurations within the DDL Settings. You can find detailed instructions on [DDL Settings Guide](https://vaultspeed.atlassian.net/wiki/x/yoh_ug).

![image](media://b49bdf8c-d9a2-404f-a7ce-1cb07eda3f9c)

  
Within the DDL settings of your application, ensure support for DDL deployment with VARCHAR(MAX). To set it, refer to the Source Length (e.g., 2*x denotes twice the Source Length).

By default, Char and VarChar Fields will be scaled by the Char Length Scaling Parameter. For PostgreSQL, VARCHAR will always be set to Max Length.

For '**Data Precision Target**' and '**Data Scale Target**', these can be left empty or derived from the Source Precision or Scale.

![image](media://6eaae220-50ba-4c60-b52e-fc72e3553afe)

### Special Values: Defining Replacement Values for Null or Unknown Data

In the **Special Values** tab, the exception values for each data type are defined.  The unknown value is used for missing references and the null value is used for replacing empty values (empty string and/or null based on the EMPTY_STRING_IS_NULL parameter) in Key Fields.

The values should be set such that they can be casted from a string to the target Data Type. For Data Types with a `GENERAL_<Type>_FORMAT` Parameter, the value of that Parameter will be used as the format during casting. For all other Data Types, no format will be specified.

![image](media://ce7664d7-d9b9-40f7-a34e-e261d1821af5)

VaultSpeed uses a default set of values depending on the chosen target technology.  The above-displayed values are the defaults for Postgres.  You can always change the defaults by using the ‘Edit’ Actions menu.