You can use the DROP VIEW statement to drop a view. This topic describes how to drop a view.
Prerequisites
The view must be in your own 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 own schema is dropped. |
| view_name | The name of the view to be dropped. |
| CASCADE | RESTRICT | CASCADE indicates that the objects dependent on the view are automatically removed. RESTRICT indicates that the view cannot be dropped if an object dependent on the view exists.
Note |
Examples
Drop the v1 view.
obclient> DROP VIEW v1;
Query OK, 0 rows affected