You can use the DROP TYPE statement to drop the specification and body of a user-defined abstract data type (ADT), variable array (VARRAY) type, or nested table type.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Prerequisites
This ADT, VARRAY type, or nested table type must be located in your own schema, or you 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 name of the schema where the type is located. The default value is your schema. |
| drop_type | type_name | The name of the ADT, VARRAY type, or nested table type to be dropped. You can drop only a type on which no type or table depends. If type_name specifies a supertype, the execution of this statement will fail. If type_name specifies a statistical information type, the execution of this statement will fail. If type_name specifies an ADT associated with a statistical information type, the database will first attempt to disassociate the ADT specified by type_name from the statistical information type, and then drop the ADT. However, if statistical information is collected by using the statistical information type, the database cannot disassociate the ADT specified by type_name from the statistical information type, and the execution of this statement will fail. If type_name specifies an index type, the database tags this index type as INVALID. If a public synonym is defined on type_name, the database will also drop this synonym. |
Examples
Drop the type named demo_typ2.
DROP TYPE demo_typ2 FORCE;