In most cases, you add new fields when you create a named ROW type as a subtype of another named ROW type (its supertype). To create the fields of a named ROW type, use the field definition clause, as described in Field Definition. When you create a subtype, you must use the UNDER keyword to associate the supertype with the named ROW type that you want to create. The next example creates the employee_t type under the person_t type:
CREATE ROW TYPE employee_t (salary NUMERIC(10,2), bonus NUMERIC(10,2)) UNDER person_t;
The employee_t type inherits all the fields of person_t and has two additional fields: salary and bonus; but the person_t type is not altered.
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]