You can execute the DROP TABLE statement to delete a table. This topic describes how to use the DROP TABLE statement to delete a table.
Syntax
DROP TABLE [ IF EXISTS ] table_name [, ...];
Note You can execute the
DROP TABLE
statement to delete multiple tables at a time.
Parameter | Description |
---|---|
IF EXISTS |
|
table_name | The name of the table that you want to delete. |
Example
The following example shows you how to use the DROP TABLE statement to delete a table:
DROP TABLE holo_test;
Use HoloWeb to visually delete a table
You can use HoloWeb to visually delete a table without the need to write SQL statements. To do so, perform the following steps:
- Go to the HoloWeb console. For more information, see HoloWeb quick start.
- In the top navigation bar of the HoloWeb console, click Metadata Management.
- Go to the Metadata Management page of the HoloWeb console. In the left-side Instance Management pane, right-click the table that you want to delete in the Instances Connected section and select Delete Table.
- In the Delete table message, click OK.
FAQ
- Issue description
Error:
ERROR: cannot drop table xxx because other objects depend on it. Detail: view xxx depends on table xxx. Hint: Use DROP ... CASCADE to drop the dependent objects too.
. - Possible cause
The table to be deleted depends on a view. Therefore, the table cannot be deleted.
- Solution
Execute the following statement to forcibly delete the table. After the statement is executed, the view that depends on the table is also deleted.
DROP TABLE [ IF EXISTS ] <table_name> [, ...] CASCADE;