Oracle7 Server SQL Reference

Contents Index Home Previous Next

DROP TABLE

Purpose

To remove a table and all its data from the database.

Prerequisites

The table must be in your own schema or you must have DROP ANY TABLE system privilege.

If you are using Trusted Oracle7 in DBMS MAC mode, your DBMS label must match the table's creation label or you must satisfy one of the following criteria:

Syntax

Keywords and Parameters

schema

is the schema containing the table. If you omit schema, Oracle7 assumes the table is in your own schema.

table

is the name of the table to be dropped.

CASCADE CONSTRAINTS

drops all referential integrity constraints that refer to primary and unique keys in the dropped table. If you omit this option, and such referential integrity constraints exist, Oracle7 returns an error message and does not drop the table.

Usage Notes

When you drop a table, Oracle7 also automatically performs the following operations:

You can drop a cluster and all of its tables using the DROP CLUSTER command with the INCLUDING TABLES clause and avoid dropping each table individually.

Example

The following statement drops the TEST_DATA table:

DROP TABLE test_data 

Related Topics

DROP CLUSTER command [*] ALTER TABLE command [*] CREATE INDEX command [*] CREATE TABLE command [*]


Contents Index Home Previous Next