1 Type
The element type allows you to create record structures that can be used by tables or by other type objects. The use of these structures also allows the creation of hierarchical data structures. Structures are very useful when creating several tables with the same composition of columns. To assign a column structure to a table, simply specify in the type attribute of the table element the name of the object assigned in the name attribute.
<type
name='name'
under='under'
>
<column /> *
</type>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | string | Type Name | |||
Aunder | string | If you want to create a subtype, you must indicate the name of the parent object, from which it will inherit its attributes. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Ecolumn | Columns that make up the structure. See section DDL:COLUMN. |
Information
In the element type, columns are indicated with the column element, in the same way as in the element DDL:TABLE.
2 Examples
In the following example two type elements are created. The first has a two-column data structure; in the second object there is an attribute under with the name of the first object, from which it will inherit its properties.
<type name='r_main'> <column name='codigo' type='integer' required='y' /> <column name='nombre' type='char' size='40' /> </type>
<type name='r_aux' under='r_main'> <column name='imploc' type='decimal' size='14, 2' required='y' /> <column name='impdiv' type='decimal' size='14, 2' required='y' /> </type>