Oracle9i SQL Reference
Release 1 (9.0.1)

Part Number A90125-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

SQL Statements:
DROP SEQUENCE to ROLLBACK, 4 of 20


DROP TABLE

Purpose

Use the DROP TABLE statement to remove a table or an object table and all its data from the database.


Caution:

You cannot roll back a DROP TABLE statement. 



Note:

For an external table, this statement removes only the table metadata in the database. It has no affect on the actual data, which resides outside of the database. 


Dropping a table invalidates the table's dependent objects and removes object privileges on the table. If you want to re-create the table, you must regrant object privileges on the table, re-create the table's indexes, integrity constraints, and triggers, and respecify its storage parameters. Truncating has none of these effects. Therefore, removing rows with the TRUNCATE statement can be more efficient than dropping and re-creating a table.

See Also:

  • CREATE TABLE for information on creating tables

  • ALTER TABLE for information on modifying tables

  • TRUNCATE and DELETE for information on how to remove data from a table without dropping the table

 

Prerequisites

The table must be in your own schema or you must have the DROP ANY TABLE system privilege.

Syntax

drop_table::=


Text description of statements_98a.gif follows
Text description of drop_table

Keywords and Parameters

schema

Specify the schema containing the table. If you omit schema, Oracle assumes the table is in your own schema.

table

Specify the name of the table, object table, or index-organized table to be dropped. Oracle automatically performs the following operations:

Restriction: You cannot directly drop the storage table of a nested table. Instead, you must drop the nested table column using the ALTER TABLE ... DROP COLUMN clause.

CASCADE CONSTRAINTS

Specify CASCADE CONSTRAINTS to drop all referential integrity constraints that refer to primary and unique keys in the dropped table. If you omit this clause, and such referential integrity constraints exist, Oracle returns an error and does not drop the table.

Example

DROP TABLE Example

The following statement drops the oe.orders table.

DROP TABLE oe.orders; 

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback