Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

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 | 



Definition and Characteristics

Definition

Allowing multiple data values to be stored in a single attribute is an extended feature of relational database. Elements of a collection are possible to have different domain each other. The domain can be one of the primitive data types or classes excluding virtual classes. For example, SET (INTEGER, tbl_1) can specify an integer or a set of row values of the user-defined class tbl_1 as a domain. When a domain list is not specified (e.g. SET ( )), all data types are allowed as elements including user-defined classes.

The data of a collection-type column with at least two domain lists can be retrieved by using the csql utility or the C-API. It cannot be retrieved in CUBRID manager or CUBRID API (JDBC, ODBC, OLEDB, PHP, CCI).

Collection Types Supported by CUBRID

Type

Description

Definition

Input Data

Stored Data

SET

A union which does not allow duplicates

col_name SET VARCHAR(20
col_name SET (int, VARCHAR(20))

{'c','c','c','b','b', 'a'}
{3,3,3,2,2,1,0,'c','c','c','b','b', 'a'}

{'a','b','c'}
{0,1,2,3,'a','b','c'}

MULTISET

A union which allows duplicates

col_name MULTISET VARCHAR(20)
col_name MULTISET (int, VARCHAR(20))

{'c','c','c','b','b', 'a'}
{3,3,3,2,2,1,0,'c','c','c','b','b', 'a'}

{'a','b','b','c','c','c'}
{0,1,2,2,3,3,3,'a','b','b', 'c','c','c'}

LIST SEQUENCE
SEQUENCE

A union which allows duplicates and stores data in the order of input

col_name LIST VARCHAR(20)
col_name LIST (int, VARCHAR(20))

{'c','c','c','b','b', 'a'}
{3,3,3,2,2,1,0,'c','c','c','b','b', 'a'}

{'c','c','c','b','b','a'}
{3,3,3,2,2,1,0,'c','c','c','b','b','a'}

As you see the table above, the value specified as a collection type can be inputted with braces ('{', '}') each value is separated with a comma (,).

Characteristics

Coercions

If the specified domains 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

-