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

MULTISET(e) (IDS)

The MULTISET data type is a collection type that stores a non-ordered set that can include duplicate element values. The elements in a MULTISET have no ordinal position. That is, there is no concept of a first, second, or third element in a MULTISET. (For a collection type with ordinal positions for elements, see the LIST data type on page LIST(e) (IDS).)

All elements in a MULTISET have the same element type. To specify the element type, use the following syntax:

MULTISET(element_type NOT NULL)

The element_type of a collection can be any of the following types:

You can use MULTISET anywhere that you use any other data type, unless otherwise indicated. For example:

You cannot use MULTISET values as arguments to an aggregate function such as AVG, MAX, MIN, or SUM.

You must specify the NOT NULL constraint for MULTISET elements. No other constraints are valid for MULTISET columns. For more information on the MULTISET collection type, see the IBM Informix: Guide to SQL Syntax.

Two multiset data values are equal if they have the same elements, even if the elements are in different positions within the set. The following examples are both multiset values but are not equal:

MULTISET {"blue", "green", "yellow"}
MULTISET {"blue", "green", "yellow", "blue"}

The following multiset values are equal:

MULTISET {"blue", "green", "blue", "yellow"}
MULTISET {"blue", "green", "yellow", "blue"}

No more than 97 columns of the same table can be declared as MULTISET data types. (The same restriction applies to SET and LIST collection types.)

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