Skip to main content

Adding User Defined Type (UDT)

A User-Defined Type (UDT) is a custom data type that allows users to model complex or domain-specific information beyond the default system types (e.g., Integer, String). Types can be used as parameters for stored procedures.

Steps to Add a Type​

  1. Create the Type

    • In the Explorer menu, right-click the created DB Entity.
    • Select Add Type.
  2. Configure Type Properties

    PropertyDescriptionComments
    Name*Name of the UDT.Must start with a character followed by alphanumeric or ''. No spaces or special characters except ''. Max length: 50 characters.
    Is Multipart FormdataUsed to handle file uploads via form submission.Default: No.
    Is BinaryIndicates whether the UDT stores binary data.Default: No.
    Is ActiveSpecifies if the UDT is accessible.Default: Yes.
    DescriptionDescription of the UDT.Optional.
  3. Click Save.

  4. Upon successful creation, the message "Type Added Successfully" appears.

  5. The created Type will be visible in the DB Entity folder with a UDT tag.

Add Attributes to a Type​

  1. Open the Type

    • Right-click on Type Entities.
    • Select 'Add/Update Attribute'.
    • Provide values for attribute properties.
  2. Configure Type Attribute Properties

    #PropertyDescription
    1NameName of the attribute.
    2DatatypeSelect from: String, Integer, Long, Double, Boolean, DateTime, Binary.
    3ScaleNumber of digits after the decimal (for Double).
    4PrecisionTotal number of digits (left and right of decimal, for Double).
    5MandatoryIndicates if the attribute is required.
    6LengthMaximum allowed size for the attribute value.
    7Date OptionChoose Fixed or Current Date.
    8Default ValueSets a default value if none is provided.
    9Example OptionProvides an example format.
    10DescriptionBrief description of the attribute.
  3. Save the Type Attributes — Click Save.

Use Case Example​

Scenario: Creating a UDT for Address Information

  1. Create a UDT called AddressType.
  2. Add Attributes:
    • Street (String, Max Length: 256)
    • City (String, Max Length: 50)
    • State (String, Max Length: 50)
    • PostalCode (String, Max Length: 10)
    • Country (String, Max Length: 50)
  3. Use AddressType in a Customer entity for managing customer addresses.

Adding User Defined Type