Purpose
You can use this statement to drop a view.
Note
The view must be in your own schema, or you must have the
DROP ANY VIEWprivilege if you want to drop the view in another user's schema.
Syntax
DROP VIEW [schema.] view_name [CASCADE RESTRICT];
Parameters
| Parameter | Description |
|---|---|
| schema. | The schema where the view to be dropped is located. If schema. is omitted, the view in your own schema is dropped. |
| view_name | The name of the view to be dropped. |
| CASCADE RESTRICT | CASCADE indicates cascading drop. If CASCADE is specified, the objects dependent on this view are also dropped. RESTRICT indicates restricted drop. If RESTRICT is specified, a view with dependent objects cannot be dropped. Note This parameter is not supported in the current database version. If this parameter is provided, it will be parsed and ignored. |
Examples
Drop the
v1view.obclient> DROP VIEW v1; Query OK, 0 rows affectedIf you do not have the
DROP ANY VIEWprivilege, the system prompts that you are not authorized to drop the view.obclient> DROP VIEW user1.v2; ORA-01031: insufficient privileges