INFORMIX
Informix Guide to SQL: Tutorial
Chapter 10: Understanding Complex Data Types
Home Contents Index Master Index New Book

Summary

Complex types comprise row types and collection types, which allow greater flexibility in how you can organize data at the level of columns and tables. When you want to store more than one kind of data in a single column, you can define a column as a row type. Row types come in two kinds: named row types and unnamed row types. A row type usually contains multiple fields. You can assign an unnamed row type to columns only. You can assign a named row type to columns or tables. When you assign a named row type to a table, the table is a typed table. A primary advantage of typed tables is that they can be used to define an inheritance hierarchy.

Inheritance is the process that allows a type or table to acquire the properties of another type or table. You can create type and table hierarchies to modify the types and tables incrementally within the respective hierarchies. In an inheritance hierarchy, a type or table can inherit a general set of properties and can add properties that are specific to itself.

To store a collection of values of a specific data type in a column, you can assign a collection type to a column. There are three kinds of collection types: SET, MULTISET, and LIST. You can define a column as a SET when you want to store collections whose elements do not contain duplicate values. You can define a column as a MULTISET when you want to store collections whose elements might contain duplicate values. You can define a column as a LIST when you want to store collections whose elements have a specific order associated with them and might contain duplicate values.




Informix Guide to SQL: Tutorial, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.