Entering content frame

DROP TABLE statement Locate the document in the library structure

A DROP TABLE statement (drop_table_statement) drops a base table.

Syntax

<drop_table_statement> ::= DROP TABLE <table_name> [<cascade_option>]

Examples

SQL Tutorial, Structure linkTables

Explanation

If the name of the schema is not specified in the table name, the current schema is accepted/used. The table name must be the name of an existing base table. The current user must be the owner of the base table or have the DROPIN privilege for the schema to which the table to be dropped belongs.

All of the metadata and rows in the base table are dropped, along with the view tables, indexes, privileges, synonyms, and referential CONSTRAINT definitions derived from the base table.

If all of the data that is linked to this base table by means of a referential CONSTRAINT definition with a DELETE rule is processed according to the specified DELETE rule, a DELETE statement must first be executed for this base table, followed by the DROP TABLE statement.

<cascade_option>

If no CASCADE option is specified, the DROP TABLE statement is executed independently of the dependencies.

·        RESTRICT: The DROP TABLE statement fails if view tables or synonyms are based on the specified table.

·        CASCADE: The DROP TABLE statement is executed independently of the dependencies.

 

Leaving content frame