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
-
Create the Type
- In the Explorer menu, right-click the created DB Entity.
- Select Add Type.
-
Configure Type Properties
Property Description Comments 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 Formdata Used to handle file uploads via form submission. Default: No. Is Binary Indicates whether the UDT stores binary data. Default: No. Is Active Specifies if the UDT is accessible. Default: Yes. Description Description of the UDT. Optional. -
Click Save.
-
Upon successful creation, the message "Type Added Successfully" appears.
-
The created Type will be visible in the DB Entity folder with a UDT tag.
Add Attributes to a Type
-
Open the Type
- Right-click on Type Entities.
- Select 'Add/Update Attribute'.
- Provide values for attribute properties.
-
Configure Type Attribute Properties
# Property Description 1 Name Name of the attribute. 2 Datatype Select from: String, Integer, Long, Double, Boolean, DateTime, Binary. 3 Scale Number of digits after the decimal (for Double). 4 Precision Total number of digits (left and right of decimal, for Double). 5 Mandatory Indicates if the attribute is required. 6 Length Maximum allowed size for the attribute value. 7 Date Option Choose Fixed or Current Date. 8 Default Value Sets a default value if none is provided. 9 Example Option Provides an example format. 10 Description Brief description of the attribute. -
Save the Type Attributes — Click Save.
Use Case Example
Scenario: Creating a UDT for Address Information
- Create a UDT called AddressType.
- 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)
- Use AddressType in a Customer entity for managing customer addresses.
