Try OpenEdge Now
skip to main content
SQL Reference
SQL Reference : OpenEdge SQL Statements : DROP TABLE
 

DROP TABLE

Deletes the specified table.
If a multi-tenant table is dropped, then, the DROP TABLE statement deletes the table partition for every tenant defined in the table.
You can also use the DROP TABLE statement to drop a partitioned table. Dropping a partitioned table is an offline operation. When a partitioned table is dropped, all the table, index, and LOB partitions of the table are deleted. A table cannot be dropped if a partition in the table is marked as a read-only partition. A partitioned table can be dropped only when all its partitions are deallocated and since read-only partitions cannot be deallocated, the table containing them cannot be dropped.
Note: The DROP TABLE statement for partitioned tables is an online operation for partitioned tables in schema other than PUB.
You can use the DROP TABLE statement as an online and offline operation. For further information, see the Notes section below.

Syntax

DROP TABLE [owner_name] table_name ;

Parameters

owner_name
Specifies the owner of the table.
table_name
Name of the table to be dropped.

Notes

*If owner_name is specified and is different from the name of the user executing the statement, then the user must have DBA privileges.
*When a table is dropped, the indexes on the table and the privileges associated with the table are dropped automatically.
*Views dependent on the dropped table are not automatically dropped, but become invalid.
*If the table is part of another table's referential constraint (if the table is named in another table's REFERENCES clause), the DROP TABLE statement fails. You must DROP the referring table first.
*When the DROP TABLE statement is applied to a multi-tenant table, it deletes the table for every tenant defined in the table.
*The DROP TABLE statement is an online operation for the following cases:
*All data in the Type II area
If tables are in the type II area but have no indexes created on them, then the DROP TABLE statement for those tables will be an offline operation.
*Tables that are not multi-tenant
*Data in schema other than PUB
*Databases without JTA transactions
*Tables without OpenEdge Replication
*The DROP TABLE statement is an offline operation for the following cases:
*Table objects (indexes and LOBs) and tables in areas other than the Type II area
*Multi-tenant tables
*Tables in PUBLIC (PUB) schema
*JTA transactions
*Tables with OpenEdge Replication

Example

The following is an example of the DROP TABLE statement:
DROP TABLE customer ;
* Authorization
* Related statement