DROP TABLE
- Last Updated: March 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
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
|
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
DBAprivileges. - 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
REFERENCESclause), theDROP TABLEstatement fails. You mustDROPthe referring table first. - When the
DROP TABLEstatement is applied to a multi-tenant table, it deletes the table for every tenant defined in the table. - The
DROP TABLEstatement is an online operation for the following cases:- All data in the Type II areaNote: If tables are in the type II area but have no indexes created on them, then the
DROP TABLEstatement 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
- All data in the Type II area
- The
DROP TABLEstatement 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: |