Online Documentation for SQL Manager for DB2
UD Types
A User-defined Type is a data type that is not native to the database manager and was created by a user.
To create a new UD Type:
- select the Database | New Object... main menu item;
- select UD Type in the Create New Object dialog;
- edit UD Type properties using the appropriate tabs of UD Type Editor.
Hint: To create a new UD Type, you can also right-click the UD Types node of the DB Explorer tree and select the New UD Type... context menu item.
To create a new UD Type with the same properties as one of existing UD Types has:
- select the Database | Duplicate Object... main menu item;
- follow the instructions of Duplicate Object Wizard.
Alternatively, you can right-click a UD Type in the DB Explorer tree and select the Duplicate UD Type <ud_type_name>... context menu item.
Duplicate Object Wizard allows you to select the database to create a new UD Type in, and to edit the result SQL statement for creating the UD Type.
To edit an existing UD Type:
- select the UD Type for editing in the DB Explorer tree (type the first letters of the UD Type name for quick search);
- right-click the object and select the Edit UD Type <ud_type_name>... context menu item, or simply double-click the UD Type;
- edit UD Type definition using the appropriate tabs of UD Type Editor.
To drop a UD Type:
- select the UD Type to drop in the DB Explorer tree;
- right-click the object and select the Drop UD Type <ud_type_name>... context menu item;
- confirm dropping in the dialog window.
Note: If more convenient, you can also use the following shortcuts:
Ctrl+N to create a new UD type;
Ctrl+O to edit the selected UD type;
Shift+Del to drop the object from the database.