DROP VIEW

USAGE

Common Syntax:

DROP VIEW [IF EXITS] <xpand_view_name> [, <xpand_view_name>] ...

Supported Syntax:

DROP {TABLE | VIEW} [IF EXITS] <xpand_view_name> {, <xpand_view_name>} ...

DETAILS

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

DROP VIEW

To delete a view in the currently selected database:

DROP VIEW view1;

The built-in function DATABASE() returns the currently selected database.

To explicitly specify a database from which to delete a view, use the DATABASE_NAME.VIEW_NAME notation:

DROP VIEW db1.view1;

IF EXISTS

By default, if you try to delete a view that does not exist, an error is raised.

To prevent an error when the specified view is not present, add the IF EXISTS clause:

DROP VIEW IF EXISTS view1;

If the specified view exists, it will be deleted. If the specified view does not exist, the query does not raise an error.

Delete Multiple Views

To delete multiple views at once, specify the names separated by commas:

DROP VIEW db1.view1, db2.view1, db3.view1;

If some of the views in the argument list do not exist, MariaDB Xpand returns an error listing non-existing views it was unable to drop, and no existing views named in the argument list get deleted.

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES