Purpose
This statement is used to drop a view.
Limitations and considerations
When dropping a view, the current user must have the DROP privilege on each view.
Privilege requirements
To execute the DROP VIEW statement, the current user must have the DROP privilege. For more information about privileges in OceanBase Database, see Privilege classification in Oracle mode.
Syntax
DROP VIEW [schema.] view_name [CASCADE | RESTRICT];
Parameters
| Parameter | Description |
|---|---|
| schema. | Specifies the schema where the view is located. If you omit schema., the view is dropped from your own schema. |
| view_name | The name of the view to be dropped. |
| CASCADE | RESTRICT | CASCADE specifies cascading deletion, which automatically deletes objects that depend on the view. RESTRICT specifies constrained deletion, which rejects the deletion of the view if there are dependent objects. Note This parameter is not supported in the current version. If specified, it will be parsed and ignored. |
Examples
Drop the view
v1.obclient> DROP VIEW v1; Query OK, 0 rows affectedIf you do not have the
DROP ANY VIEWprivilege, you will be prompted that you do not have sufficient privileges when dropping a view.obclient> DROP VIEW user1.v2; ORA-01031: insufficient privileges