Creating unnamed ROW types

About this task

You can create an unnamed ROW type in several ways:
  • You can declare an unnamed ROW type using the ROW keyword. Each field in a ROW can have a different field type. To specify the field type, use the following syntax:
    ROW(field_name field_type, ...)

    The field_name must conform to the rules for SQL identifiers. (See the Identifier section in the HCL OneDB™ Guide to SQL: Syntax.)

  • To generate an unnamed ROW type, use the ROW keyword as a constructor with a series of values. A corresponding unnamed ROW type is created, using the default data types of the specified values.
    For example, the following declaration:
    ROW(1, 'abc', 5.30)
    defines this unnamed ROW data type:
    ROW (x INTEGER, y VARCHAR, z DECIMAL)
  • You can create an unnamed ROW type by an implicit or explicit cast from a named ROW type or from another unnamed ROW type.
  • The rows of any table (except a table defined on a named ROW type) are unnamed ROW types.

No more than 195 columns of the same table can be unnamed ROW types.