Access a collection

HCL OneDB™ supports the following kinds of collections:
  • The SET data type stores a collection of elements that are unique values and have no ordered positions.
  • The MULTISET data type stores a collection of elements that can be duplicate values and have no ordered positions.
  • The LIST data type stores a collection of elements that can be duplicate values and have ordered positions.
Both SQL and enable you to use the SQL collection derived table clause to access the elements of a collection as if they were rows in a table. In , the collection derived table takes the form of a collection variable. The collection variable is a host variable into which you retrieve the collection. After you have retrieved the collection into a collection variable, you can perform select, insert, update, and delete operations on it, with restrictions.
Important: When the SQL statement references a collection variable, and not the database server, processes the statement.

SQL allows you to perform read-only (SELECT) operations on a collection by implementing the collection derived table as a virtual table.