DROP VIEW

2023-08-18 09:26:34  Updated

Description

You can execute the DROP VIEW statement to delete one or more views. Note

Before you execute this statement, ensure you have the global DROP permission.

Syntax

drop_view_stmt:
    DROP VIEW [IF EXISTS] view_name_list [CASCADE | RESTRICT];

view_name_list:
    view_name [, view_name_list]

Parameters

Parameter Description
IF EXISTS If you add IF EXISTS to the statement and the specified views do not exist, the system does not return an error.
view_name_list If some views you specify in view_name_list do not exist, the system may return an error. However, the system still deletes the views that exist.
CASCADE | RESTRICT CASCADE and RESTRICT are parsed and ignored.

Examples

Execute the following statements to delete views v1 and v2: Assume that v1 or v2 does not exist. If you execute the first statement, the system returns an error.

drop view v1, v2;

drop view if exists v1, v2;

Contact Us