You can use the DROP TYPE statement to drop a user-defined abstract data type (ADT), a VARRAY type, or a nested table, including its specifications (rules) and implementation (body).
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Prerequisites
The ADT, VARRAY type, or nested table to be dropped exists in your schema, or you 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 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 has been defined on type_name, the database will also drop this synonym. You can use the FORCE keyword to forcibly drop a type with dependencies. |
Examples
Drop the type named demo_typ2.
DROP TYPE demo_typ2 FORCE;