Opaque Data Types

An opaque data type is a user-defined or built-in data type that is fully encapsulated. The internal structure of an opaque data type is unknown to the database server.

Except for user-defined types (UDTs) that are DISTINCT of built-in non-opaque types, UDTs whose source types are built-in types are opaque data types. Similarly, UDTs that are DISTINCT of built-in opaque types are opaque types.

Built-in opaque data types

The built-in data types BLOB, BOOLEAN, CLOB, BSON, JSON, and LVARCHAR are implemented as opaque data types. You can access all of these in other databases of the same HCL OneDB™ instance, but you cannot access the BLOB or CLOB built-in opaque data types in cross-server distributed operations.

UDTs that are DISTINCT of built-in opaque types and that are cast to built-in types are valid in cross-server queries and other DML operations, but all the casts and all the DISTINCT OF definitions for the UDTs must be identical in every participating database.

Several system catalog tables, whose schema are shown in Structure of the System Catalog, have columns of built-in opaque data types. For information on how the system catalog emcodes columns of built-in opaque data types, see SYSCOLUMNS.

User-defined opaque data types

You must provide the following information to the database server for an opaque data type:
  • A data structure for how the data values are stored on disk
  • Support functions to determine how to convert between the disk storage format and the user format for data entry and display
  • Secondary access methods that determine how the index on this data type is built, used, and manipulated
  • User functions that use the data type
  • A system catalog entry to register the opaque type in the database
The internal structure of an opaque type is not visible to the database server and can only be accessed through user-defined routines. Definitions for opaque types are stored in the sysxtdtypes system catalog table. These SQL statements maintain the definitions of opaque types in the database:
  • The CREATE OPAQUE TYPE statement registers a new opaque type in the database.
  • The DROP TYPE statement removes a previously defined opaque type from the database.

For more information, see the section OPAQUE data types. See also HCL OneDB User-Defined Routines and Data Types Developer's Guide.