SET(e) data type
The SET data type is an unordered collection type that stores unique elements
Duplicate element values are not valid as explained in Informix® Guide to SQL: Syntax. (For a collection type that supports duplicate values, see the description of MULTISET in MULTISET(e) data type.)
No more than 97 columns of the same table can be declared as SET data types. (The same restriction also applies to MULTISET and LIST collection types.)
SET(element_type NOT NULL)
- A built-in type, except SERIAL, SERIAL8, BIGSERIAL, BYTE, and TEXT
- A named or unnamed ROW type
- Another collection type
- An opaque type
You must specify the NOT NULL constraint for SET elements. No other constraints are valid for SET columns. For more information about the syntax of the SET collection type, see the Informix® Guide to SQL: Syntax.
- After the IN predicate in the WHERE clause of a SELECT statement to search for matching SET values
- As an argument to the CARDINALITY or mi_collection_card( ) function to determine the number of elements in a SET column
SET values are not valid as arguments to an aggregate function such as AVG, MAX, MIN, or SUM. For more information, see the Condition and Expression sections in the Informix® Guide to SQL: Syntax.
SET(INTEGER NOT NULL)
SET(CHAR(20) NOT NULL)
SET{1, 5, 13}
SET{"Oakland", "Menlo Park", "Portland", "Lenexa"}
CREATE TABLE tab
(
c CHAR(5),
s SET(INTEGER NOT NULL)
);
SET{"blue", "green", "yellow"}
SET{"yellow", "blue", "green"}