DROP VIEW (Databricks SQL)

Tar bort de metadata som är associerade med en angiven vy från katalogen.

Syntax

DROP VIEW [ IF EXISTS ] view_name

Parameter

  • OM FINNS

    Om detta anges, kommer inget undantag att visas när vyn inte finns.

  • view_name

    Namnet på vyn som ska tas bort.

Exempel

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

-- Assumes a view named `employeeView` exists in the `userdb` database
> DROP VIEW userdb.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;