Versions available for this page: CUBRID 8.3.1 | CUBRID 8.4.0 | CUBRID 8.4.1 | CUBRID 8.4.3 | CUBRID 9.0.0 |
Allowing multiple data values to be stored in a single attribute is an extended feature of relational database. Each element of a collection is possible to have different data type each other except View.
|
Type |
Description |
Definition |
Input Data |
Stored Data |
|---|---|---|---|---|
|
SET |
A union which does not allow duplicates |
col_name SET VARCHAR(20) |
{'c','c','c','b','b','a'} |
{'a','b','c'} |
|
MULTISET |
A union which allows duplicates |
col_name MULTISET VARCHAR(20) |
{'c','c','c','b','b','a'} |
{'a','b','b','c','c','c'} |
|
LIST |
A union which allows duplicates and stores data in the order of input |
col_name LIST VARCHAR(20) |
{'c','c','c','b','b','a'} |
{'c','c','c','b','b','a'} |
As you see the table above, the value specified as a collection type can be inputted with curly braces ('{', '}') each value is separated with a comma (,).
Coercions
If the specified collection types are identical, the collection types can be cast explicitly by using the CAST operator. The following table shows the collection types that allow explicit coercions.
Explicit Coercions
|
|
TO |
|||
|---|---|---|---|---|
|
FROM |
|
SET |
MULTISET |
LIST |
|
SET |
- |
O |
O |
|
|
MULTISET |
O |
- |
X |
|
|
LIST |
O |
O |
- |
|