This topic describes how to drop a table in OceanBase Database in Oracle mode.
Prerequisites
The current user has the DROP privilege for the target table.
Syntax
DROP TABLE table_name [CASCADE CONSTRAINTS] [PURGE];
Parameters
| Parameter | Description |
|---|---|
| table_name | The name of the table to be dropped. |
| CASCADE CONSTRAINTS | Drops the constraints correlated with the table specified by table_name. |
| PURGE | Purges the table (without moving it to the recycle bin). |
Examples
View the structure of the
dws_nytable.obclient>SELECT t.table_name tablename FROM user_tables t; +-----------+ | TABLENAME | +-----------+ | CUST | | WARE | | T1 | | DWS_NY | +-----------+ 4 rows in setDrop the
dws_nytable.obclient> DROP TABLE dws_ny; Query OK, 0 rows affectedView the results.
obclient> SELECT t.table_name tablename FROM user_tables t; +-----------+ | TABLENAME | +-----------+ | CUST | | WARE | | T1 | +-----------+ 3 rows in set