Compartir a través de


DROP VIEW

Se aplica a:casilla marcada como Sí Databricks SQL casilla marcada como Sí Databricks Runtime

Quita los metadatos asociados a una vista especificada del catálogo. Para quitar una tabla, deberá ser su propietario o el propietario del esquema, catálogo o metastore en el que resida la visualización.

Sintaxis

DROP [ MATERIALIZED ] VIEW [ IF EXISTS ] view_name

Parámetro

Ejemplos

-- Assumes a view named `employeeView` exists.
> DROP VIEW employeeView;

-- Assumes a view named `employeeView` exists in the `usersc` schema
> DROP VIEW usersc.employeeView;

-- Assumes a view named `employeeView` does not exist.
-- Throws TABLE_OR_VIEW_NOT_FOUND
> DROP VIEW employeeView;
  [TABLE_OR_VIEW_NOT_FOUND]

-- Assumes a materialized view named `employeeView` exists.
> DROP MATERIALIZED VIEW employeeView

-- Assumes a view named `employeeView` does not exist. Try with IF EXISTS
-- this time it will not throw exception
> DROP VIEW IF EXISTS employeeView;