Name

DROP TABLE

Synopsis

DROP TABLE
[schema.]table_name
   CASCADE CONSTRAINTS

Removes a table (table_name) from the database.

Keyword

CASCADE CONSTRAINTS

Specifies that all referential integrity constraints that refer to primary and unique keys in the table to be dropped will also be dropped.

Notes

The table to be dropped must be in your schema, or you must have the DROP ANY TABLE privilege to remove a table from another schema. When you drop a table, all rows are deleted and any indexes on the table are automatically deleted, regardless of what schema created or owns them. If the table to be dropped is a base table for a view, or if it is referenced in any stored procedure, the view or procedure will be marked invalid, but not dropped. If the table is the master table for a snapshot, the snapshot is not dropped, and if the table has a snapshot log, that snapshot log is not dropped.

Example

The following example removes scott’s emp table from the database:

DROP TABLE scott.emp
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset