EQL represents multi-assign attributes from collections as sets.
A set consists of a group of elements, typically derived from the values of a multi-assign attribute. EQL sets are intended to behave like mathematical sets: the order of the elements within a set is not specified (and, in general, not observable). An empty set is a set that contains no elements.
All elements in a set must be of the same data type. If the elements in the set come from two multi-assign attributes (for example, by using the INTERSECTION row function), then those two multi-assign attributes must be of the same data type. Sets may not contain duplicate values and sets may not contain other sets.
All of these methods are described in this section.
Note that sets are not persistent from one EQL query to another.
{3, 4.0, 'five'}
is invalid because it contains an integer, a double, and a string.
Sets may not contain NULL values. In addition, sets may not be NULL, but they may be empty. These requirements apply to both multi-assign collection attributes and other expressions of set type.
If a collection record has no assignments for a multi-assign attribute, then in an EQL query, that attribute's value for that record is the empty set.
The results of an EQL statement (whether DEFINE or RETURN) may contain sets. This means, for instance, that you can define an entity (view) that provides all of the values of a multi-assign attribute to queries that use that entity.
Note that the IS NULL and IS NOT NULL operations are not supported on sets. Instead, use the IS_EMPTY and IS_NOT_EMPTY functions to determine whether a set is empty. Likewise, the IS_EMPTY and IS_NOT_EMPTY functions cannot be used on atomic values (such as on a single-assign attribute).
Set equality is the same as mathematical set equality: two sets are equal if and only if they contain exactly the same elements, no more, no less. The order of the elements in the set is immaterial. Two empty sets are equal.
Set equality and inequality are defined only on two sets of the same type. For example, you cannot compare an mdex:long-set and an mdex:geocode-set for equality; doing so will result in an EQL type error.
You can use the = (equal) and <> (not equal) operators to test for equality between sets. Note that the < (less than) and > (greater than) operators are not defined for sets.
This chapter documents the aggregation and row functions that are used with sets.
As mentioned above, you can use the = (equal) and <> (not equal) operators to test for equality between sets. The other operators (such as the * multiplication operator) cannot be used on sets.