Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements >

DROP TYPE

Use the DROP TYPE statement to remove a user-defined distinct or opaque data type from the database. (You cannot use this to drop a built-in data type.)

Only Dynamic Server supports this statement, which is an extension to the ANSI/ISO standard for SQL.

Syntax

Read syntax diagramSkip visual syntax diagram>>-DROP TYPE--+------------+--data_type--RESTRICT--------------><
              '- owner-- .-'
 

Element Description Restrictions Syntax
data_type Distinct or opaque data type to be removed Must be an existing distinct or opaque type in the local database; cannot be a built-in data type Identifier;
Data Type
owner Name of data type owner Must own the data type Owner Name

Usage

To drop a distinct or opaque data type with the DROP TYPE statement, you must be the owner of the data type or have the DBA privilege. When you use this statement, you remove the data type definition from the database (in the sysxtdtypes system catalog table). In general, this statement does not remove any definitions of casts or of support functions associated with that data type.

Important:
When you drop a distinct type, the database server automatically drops the two explicit casts between the distinct type and the type on which it is based.

You cannot drop a distinct or opaque type if the database contains any casts, columns, or user-defined functions whose definitions reference the data type.

The following statement drops the new_type data type:

DROP TYPE new_type RESTRICT

Related Information

Related statements: CREATE DISTINCT TYPE, CREATE OPAQUE TYPE, CREATE ROW TYPE , DROP ROW TYPE , and CREATE TABLE

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]