Complex Data Type

Complex data types are ROW types or COLLECTION types that you create from built-in types, opaque types, distinct types, or other complex types.
(1)
Complex Data Type

1  %Row Data Types1
1  %Collection
Data Types2

A single complex data type can include multiple components. When you create a complex type, you define the components of the complex type. Unlike an opaque type, however, a complex type is not encapsulated. You can use SQL to access the individual components of a complex data type. The individual components of a complex data type are called elements.

HCL OneDB™ supports the following categories of complex data types:
  • ROW data types: Named ROW types and unnamed ROW types
  • COLLECTION data types: SET, MULTISET, and LIST

The elements of a COLLECTION data type must all be of the same data type. You can use the keyword COLLECTION in SPL data type declarations to specify an untyped collection variable. NULL values are not supported in elements of COLLECTION data types.

The elements of a ROW data type can be of different data types, but the pattern of data types from the first to the last element cannot vary for a given ROW data type. NULL values are supported in elements of ROW data types, unless you specify otherwise in the data type declaration or in a constraint.