DROP VIEW (Databricks SQL)

Quita los metadatos asociados a una vista especificada del catálogo.

Syntax

DROP VIEW [ IF EXISTS ] view_name

Parámetro

  • IF EXISTS

    Si se especifica, no se produce ninguna excepción si la vista no existe.

  • view_name

    Nombre de la vista que se va a quitar.

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 exception
> DROP VIEW employeeView;
  Error: Table or view not found: 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;