User-defined types

Overview

User-Defined Types (UDTs) are a user restriction on a built-in type. They can be used as an alias to a built-in type, restricted to a given length/precision.

Examples:

  • GenericNameType type can be defined as a String(80)

  • ZipCodeType can be used as an alias for Decimal(5,0).

Create a user-defined type

To create a user-defined type:

  1. Right-click the User-defined Types node and select Add User-defined Type…. The Create New User-defined Type wizard opens.

  2. In the Create New User-defined Type wizard, check the Auto Fill option and then enter the following values:

    • Name: Internal name of the user-defined type

    • Label: User-friendly label in this field. Note that as the Auto Fill box is checked, the Label is automatically filled in. Modifying this label is optional.

    • Built-in Type: Select a type from the list.

    • Length, Precision, Scale. Size for this user-defined type. The fields available depend on the built-in type selected. For example, a String built-in type will only allow entering a Length.

  3. Click Finish to close the wizard. The User-defined Type editor opens.

  4. In the Description field, optionally enter a description for the user-defined type.

  5. Press Control+S (or Command+S on macOS) to save the editor.

  6. Close the editor.