Opaque data types

An opaque data type is an atomic data type that you define for the database. An opaque data type gets its name from the fact that the database server maintains no information about the internal representation of the data type. Unlike built-in types, for which the database server maintains information about the internal format, the opaque types are encapsulated; that is, the database server has no knowledge of the format of the data within an opaque data type.

When you define an opaque data type, you extend the data type system of the database server. You can use the new opaque data type in the same way as any built-in data type that the database server provides. To define the opaque data type to the database server, you must provide the following information in an external language (C or Java™):
  • A data structure that defines the internal storage of the opaque data type
  • Support functions that allow the database server to interact with this internal structure
  • Optional modifiers that specify how the data type should be treated
  • Optional additional routines that can be called by other support functions or by end users to operate on the opaque data type

The following topics introduce each of these parts of an opaque data type. For information about how to create these parts, see Creating an opaque data type.