The DROP TYPE statement is used to drop the specification and body of a user-defined abstract data type (ADT), VARRAY, or nested table type.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Prerequisites
The ADT, VARRAY, or nested table type must be in the current user's schema, or the user must have the ALTER ANY TYPE system privilege.
Syntax
The syntax of drop_type is as follows:
DROP TYPE [ schema. ] type_name [ FORCE | VALIDATE ] ;
Semantics
Syntax |
Keyword or syntax node |
Description |
|---|---|---|
| drop_type | schema | The schema name where the type is located. The default value is the current user's schema. |
| drop_type | type_name | The name of the object, VARRAY, or nested table type to be dropped. Only types without type or table dependencies can be dropped. If type_name is a supertype, the statement will fail. If type_name is a statistics type, the statement will fail. If type_name is an ADT associated with a statistics type, the database first attempts to dissociate the ADT from the statistics type, then drops type_name. However, if statistics have been collected using the statistics type, the database cannot dissociate the ADT from the statistics type, and the statement will fail. If type_name is an index type, the index type is marked as INVALID. If a public synonym is defined on type_name, the database will also drop the synonym. |
Examples
Drop the demo_typ2 type.
DROP TYPE demo_typ2 FORCE;
