DROP MATERIALIZED VIEW

This command drops the specified materialized view and deletes its data.

Note that if there are existing jobs that are dependent upon the materialized view in question, then it cannot be dropped.

Syntax

DROP MATERIALIZED VIEW [ IF EXISTS ] <mv_identifier>
    [ COMPUTE_CLUSTER = <cluster_identifier> ];

COMPUTE_CLUSTER

Type: identifier

Default: The sole cluster in your environment

(Optional) The cluster that processes the deletion.

This option can only be omitted when there is just one cluster in your environment.

When you have more than one compute cluster, you are required to provide which one to use through this option.

IF EXISTS

(Optional) To prevent the Upsolver query engine from returning an error if the materialized view does not exist, include IF EXISTS in your DROP statement; instead, you will see the message Operation resulted in no change.

Example

The following example runs a DROP statement with IF EXISTS to drop the materialized view, sales_data_totals. By including IF EXISTS, an error is not encountered if the materialized view does not exist. Otherwise, if the materialized view exists, it will be dropped from the organization:

DROP MATERIALIZED VIEW IF EXISTS "sales_data_totals";

Last updated