DROP VIEW

Documentation

VoltDB Home » Documentation » Using VoltDB

DROP VIEW

DROP VIEW — Removes a view and any data associated with it.

Synopsis

DROP VIEW view-name [IF EXISTS]

Description

The DROP VIEW statement deletes the specified view, and any data associated with it, from the database. The IF EXISTS clause allows the statement to succeed even if the specified view does not exist. If the view does not exist and you do not include the IF EXISTS clause, the statement will return an error.

Dropping a view has the same constraints as dropping a table, in that you cannot drop a view that is referenced by existing stored procedure queries. Before dropping the view, you must drop any stored procedures that reference it.

Examples

The following example removes the view named Votes_by_state:

DROP VIEW votes_by_state;