DROP TABLE Statement
To drop a table, use the SQL DDL DROP TABLE statement. Use the CASCADE option if the table participates in a referential constraint or is referenced in one or more view definitions.
No CASCADE
When you drop a table (without CASCADE), the following definitions are removed from the dictionary:
Table rows and indexes are removed from the database.
With CASCADE
If you specify CASCADE, these additional definitions are removed from the dictionary:
Considerations
Using FORMAT to Erase Table Rows
If the table you want to drop is the only table in an area, it participates in no linked constraints and its indexes (if any) also reside in areas in which no other table or index resides, you can use the FORMAT utility to drop the table more efficiently:
Note: For more information about FORMAT, see the CA IDMS Utilities Guide.
Dropping All Tables in a Schema
If you want to drop all tables in a schema, use the DROP SCHEMA statement with the CASCADE option rather than dropping each table individually.
Example
In the following example, these entities are dropped: the BENEFITS table, its CALC key, all indexes defined on it, all privileges on it, all referential constraints in which BENEFITS participates, all views in which this table is referenced and all views referencing that view, and all privileges granted on all those views. In addition, all data will be deleted.
drop table demoempl.benefits cascade;
|
Copyright © 2014 CA.
All rights reserved.
|
|