PreviousSQL Engine Reference (9.1 revision 1) Next

DROP TABLE

Show this topic in Library frames

This statement removes a table from a designated database.

Syntax

DROP TABLE table-name [ IN DICTIONARY ] 

Arguments

table-name 

The name of the table that you want to remove.

IN DICTIONARY 

See the discussion of IN DICTIONARY forALTER TABLE .

Remarks

CASCADE and RESTRICT are not supported.

If any triggers depend on the table, the table is not dropped.

If a transaction is in progress and refers to the table, then an error is signalled and the table is not dropped.

The drop of table fails if other tables depend on the table to be dropped.

If a primary key exists, it is dropped. The user need not drop the primary key before dropping the table. If the primary key of the table is referenced by a constraint belonging to another table, then the table is not dropped and an error is signalled.

If the table has any foreign keys, then those foreign keys are dropped.

If the table has any other constraints (for example, NOT NULL, CHECK, UNIQUE, or NOT MODIFIABLE), then those constraints are dropped when the table is dropped.

Examples

The following statement drops the class table definition from the dictionary.

DROP TABLE Class 

See Also

ALTER TABLE

CREATE TABLE


Chapter contents
Publication contents

Prev topic: DROP PROCEDURE
Next topic: DROP TRIGGER