EPUB | CHM | PDF

How to Create a Domain

Top Previous Next

The Domain & User Defined Type Manager is intended for managing diagram domains, composite and scalar user defined types, which can be used for faster creating and modifying table columns, stored procedures etc.

To open the Domain & User Defined Type Manager, select the Diagram | Domain & User Defined Type Manager menu item.

editor-domain-and-UDT-Domains

The Domain page consists of the following areas:

Domain List

The Domains list displays all the domains in the diagram and allows you to modify the following domain properties:

§Domain name - the name of the domain, which must be unique within the schema;
§Data type - the data type of the domain;
§Comment - an arbitrary description for the domain.
§Schema - the database schema that domain belongs to.

Properties Pane

The properties pane allows you to define the advanced properties of the domain, selected in the Domain List. The appearance of this pane changes according to the data type of the domain. These properties are:

§Not null - this option indicates that a domain-based column value cannot be NULL;
§Default - this attribute defines the default value, which the domain-column accepts if no other is specified;
§Checks - this property specifies integrity constraints or tests which values of the domain must satisfy. Each constraint must be an expression producing a Boolean result. It should use the name VALUE to refer to the value being tested.

Buttons Pane

The buttons under the list of domains allows you to perform the following actions:

§Add - add a new domain with the default properties to the end of the list;
§Duplicate - add a new domain with the same properties as the selected domain to the end of the list;
§Delete - remove the selected domain from the list.

editor-domain-and-UDT-Composites

The Composite page consists of the following areas:

Composite List

The Composite list displays all the composites in the diagram and allows you to modify the following composite properties:

§Type name - the name of the composite type, which must be unique within the schema;
§Comment - an arbitrary description for the composite type.
§Schema - the database schema that composite type belongs to.

Type Attribute (Column) List

Type Attribute (Column) List displays all the columns in the selected composite type and allows you to modify the following properties:

§Attribute name - the name of the composite type attribute, which must be unique within the parent type;
§Type - the data type of the attribute.

Properties Pane

The properties pane allows you to define the advanced properties of the attribute, selected in the Type Attribute List. The appearance of this pane changes according to the data type of the attribute. These properties are:

§Length - this option indicates maximum allowed length for a column;
§Decimals - this attribute defines the number of decimal digits in the fractional part of a numeric attribute;
§Comment - an arbitrary description for the composite type attribute.

Buttons Pane

The Buttons Pane is similar to Buttons Pane on the Domain Page, but have additional buttons:

The buttons under the list of columns allow you to perform the following actions:

§Up/Down - move the selected column along the list;
§Add - add a new column with the default properties to the end of the list;
§Delete - remove the selected column from the list.

editor-domain-and-UDT-Scalars

The Scalar page consists of the following areas:

Scalar List

The scalar list displays all the scalars in the diagram and allows you to modify the following scalar properties:

§Scalar name - the name of the scalar, which must be unique within the schema;
§Comment - an arbitrary description for the scalar;
§Schema - the database schema that scalar belongs to;
§Element - specifies that scalar type being created is an array; this specifies the type of the array elements.

Properties Pane

The properties pane allows you to define the advanced properties of the scalar, selected in the Scalar List. These properties are:

§Input - the name of a function that converts data from the type's external textual form to its internal form;
§Output - the name of a function that converts data from the type's internal form to its external textual form;
§Receive - the name of a function that converts data from the type's external binary form to its internal form;
§Send - the name of a function that converts data from the type's internal form to its external binary form;
§Analyze - the name of a function that performs statistical analysis for the data type;
§Alignment - the storage alignment requirement of the data type. It must be CHAR, INT2, INT4, or DOUBLE; the default is INT4;
§Length - a numeric constant that specifies the length in bytes of the new type's internal representation. The default assumption is that it is variable-length;
§Storage - the storage strategy for the data type. If specified, must be PLAIN, EXTERNAL, EXTENDED, or MAIN; the default is PLAIN;
§By Value - indicates that values of this data type are passed by value, rather than by reference;
§Delimiter - the delimiter character to be used between values in arrays made of this type;
§Default - the default value for the data type. If this is omitted, the default is null.

Buttons Pane

The buttons under the list of scalars allows you to perform the following actions:

§Add - add a new scalar with the default properties to the end of the list;
§Duplicate - add a new scalar with the same properties as the selected scalar to the end of the list;
§Delete - remove the selected scalar from the list.

See also:
Diagram Objects: Domains & User Defined Types | Columns | Stored Routine Editor