|
ALTER TABLE Statement | Database Tables |
statement_DROP_TABLE ::= DROP [ IF EXISTS ] TABLE [scheme.]table name [ method ]
method ::= CASCADE | RESTRICT
Description
The DROP TABLE statement deletes the specified table.
If the table of the specified name does not exist in the schema, the error sqlstate W0137 (OBJECT_DOES_NOT_EXIST) occurs.
This statement may not be used on a temporary table.
If the CASCADE method is used, all referenced tables using referential integrity are deleted as well. If the RESTRICT method is used, you will not be able to delete the table since the referential integrity error sqlstate W0162 (REFERENCED_BY_OTHER_TABLE) will occur.
If the table is prefixed with an application name (on the same server), the table is searched for in the specified application (schema).
The DROP TABLE statement executes a COMMIT before and after execution. This statement cannot be rolled back.
DELETE triggers for each record will not execute when deleting the entire table.
602SQL Variations
Example:
DROP TABLE Employed
ALTER TABLE Statement | Database Tables |