Home | Previous Page | Next Page   Data Types > Description of Data Types >

ROW, Named (IDS)

A named ROW type is declared by its name. That identifier must be unique within the schema. An unnamed ROW type is a ROW type that contains fields but has no user-defined name. Only named ROW types support data type inheritance. For more information, see ROW Data Types.

Defining Named ROW Types

You must declare and register in the database a new named ROW type by using the CREATE ROW TYPE statement of SQL. Definitions for named ROW types are stored in the sysxtdtypes system catalog table.

The fields of a ROW data type can be any built-in data type or UDT, but TEXT or BYTE fields of a ROW type are valid in typed tables only. If you want to assign a ROW type to a column, its elements cannot be TEXT or BYTE data types.

In general, the data type of a field of a ROW type can be any of these types:

These SQL statements maintain the definitions of named ROW data types:

No more than 195 columns of the same table can be named ROW types.

For details about these SQL syntax statements, see the IBM Informix: Guide to SQL Syntax. For examples of how to create and use named ROW types, see the IBM Informix: Database Design and Implementation Guide.

Equivalence and Named ROW Types

No two named ROW types can be equal, even if they have identical structures, because they have different names. For example, the following named ROW types have the same structure (the same number of fields and the same order of data types of fields within the row) but are not equal:

name_t (lname CHAR(15), initial CHAR(1), fname CHAR(15))
emp_t (lname CHAR(15), initial CHAR(1), fname CHAR(15))

Named ROW Types and Inheritance

Named ROW types can be part of a type-inheritance hierarchy. One named ROW type can be the parent (or supertype) of another named ROW type. A subtype in a hierarchy inherits all the properties of its supertype. Type inheritance is discussed in the CREATE ROW TYPE statement in the IBM Informix: Guide to SQL Syntax and in the IBM Informix: Database Design and Implementation Guide.

Typed Tables

Tables that are part of an inheritance hierarchy must be typed tables. Typed tables are tables that have been assigned a named ROW type. For the syntax you use to create typed tables, see the CREATE TABLE statement in the IBM Informix: Guide to SQL Syntax. Table inheritance and its relation to type inheritance is also discussed in that section. For information about how to create and use typed tables, see the IBM Informix: Database Design and Implementation Guide.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]