Purpose
This statement is used to delete a table from the database.
Privilege requirements
To execute the DROP TABLE statement, the current user must have the DROP system privilege. For more information about OceanBase Database privileges, see Privilege classification in Oracle-compatible mode.
Syntax
DROP TABLE table_name [CASCADE CONSTRAINTS] [PURGE];
Parameters
| Parameter | Description |
|---|---|
| table_name | Specifies the name of the table to be deleted. |
| CASCADE CONSTRAINTS | Cascades the deletion to constraints associated with table_name. |
| PURGE | Permanently deletes the table (without placing it in the recycle bin). |
Examples
Delete the tbl1 table.
obclient> DROP TABLE tbl1;
Query OK, 0 rows affected