Purpose
You can use this statement to drop a view.
Note
The view must be in your schema, or you must have the DROP ANY VIEW privilege 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 schema is dropped. |
| view_name | The name of the view to be dropped. |
| CASCADE | RESTRICT | CASCADE specifies that the objects dependent on the view are automatically dropped. RESTRICT specifies that the view cannot be dropped if an object that depends on the view exists. Note The current version does not support this parameter. If this parameter is specified, 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