DROP VIEW statement

The DROP VIEW statement removes the specified view.

A view is created by a CREATE VIEW statement.

Syntax

DROP VIEW viewName

Example

DROP VIEW AnIdentifier

Statement dependency system

Any statements referencing the view are invalidated on a DROP VIEW statement. DROP VIEW fails if there are any views, triggers, or open cursors dependent on the view.

Normally, you must drop a view before you drop any objects that the view depends on. However, if you issue an ALTER TABLE DROP COLUMN command with the CASCADE option, any views that depend on the column will be dropped. Also, if you use a REVOKE statement to revoke privileges on objects that a view depends on, the view will be dropped. Similarly, if you use a DROP ROLE statement to drop a role that has privileges on objects that a view depends on, the view will be dropped.

Related reference
DROP DERBY AGGREGATE statement
DROP FUNCTION statement
DROP INDEX statement
DROP PROCEDURE statement
DROP ROLE statement
DROP SCHEMA statement
DROP SEQUENCE statement
DROP SYNONYM statement
DROP TABLE statement
DROP TRIGGER statement
DROP TYPE statement