CREATE OPAQUE TYPE statement

Use the CREATE OPAQUE TYPE statement to create an opaque data type.

This statement is an extension to the ANSI/ISO standard for SQL.

Syntax

(1)
Element Description Restrictions Syntax
length Number of bytes needed to store a value of this data type Positive integer returned when sizeof( ) directive is applied to the type structure Literal Number
type Name that you declare here for the new opaque data type Must be unique among data type names in the database Identifier

Usage

The CREATE OPAQUE TYPE statement registers a new opaque data type in the sysxtdtypes system catalog table.

If you include the optional IF NOT EXISTS keywords, the database server takes no action (rather than sending an exception to the application) if an OPAQUE data type of the specified name is already registered in the current database.

To create an opaque type, you must have the Resource privilege on the database. When you create the opaque type, only you, the owner, have the Usage privilege on the new opaque data type. You can use the GRANT or REVOKE statements to grant or revoke the Usage privilege of other users of the database.

To view the privileges on a data type, check the sysxtdtypes system catalog table for the owner name, and check the sysxtdtypeauth system catalog table for additional type privileges that might have been granted.

For details of system catalog tables, see the HCL OneDB™ Guide to SQL: Reference.

The DB-Access utility can also display privileges on opaque data types.