Functions, Operators, Switch Cases and Truth Tables : Constant Operators and Enumerated Types : Operators Related to Enumerated Values

Operators Related to Enumerated Values

The following table lists the operators that support operations on enumerated values.

 

Parameters to these operators are either enumerated values (literals) or variables. The T'VAL notation is used for non-unique literals. For example:

A user-defined type DAY is defined as enumerated type with the following values:

{SUN,MON,TUE,WED,THU,FRI,SAT}

Another UDT VACATION can be defined as of type User-Type DAY with subrange {FRI,SAT}.
The order of enumerated values within the subtype should be defined as a segment of the original type. For example, MON must always be greater than SUN.

Ordinal values start with 0 (zero). The ordinal of the values of a subtype is defined by the position in the original type definition. For example:

enum_ordinal(DAY'FRI) == enum_ordinal(VACATION'FRI) == 5