TRUNCATE TABLE CASCADE
In
the previous releases, there wasn’t a direct option provided to
truncate a master table while it is referred to by the child tables and
child records exist. The TRUNCATE TABLE with CASCADE option in 12c
truncates the records in the master table and automatically initiates
recursive truncate on child tables too, subject to foreign key reference
as DELETE ON CASCADE. There is no CAP on the number of recursive levels
as it will apply on all child, grand child and great grandchild etc.
This
enhancement gets rid of the prerequisite to truncate all child records
before truncating a master table. The newCASCADE clause can also be
applied on table partitions and sub-partitions etc.
SQL> TRUNCATE TABLE <table_name> CASCADE;
SQL> TRUNCATE TABLE <table_name> PARTITION <partition_name> CASCADE;
An ORA-14705 error will be thrown if no ON DELETE CASCADE option is defined with the foreign keys of the child tables.

96171FD6
ReplyDeleteZonguldak
Antep
Konya
Düzce
Tunceli
Bartın
Ağrı
Uşak
Siirt
B9A773B6
ReplyDeleteŞehitkamil
Kiraz
Silifke
Kepez
Ayaş
Lapseki
Alanya
Elvankent
Aksu
840E287C
ReplyDeleteMezitli
Aktepe
Edremit
Kepez
Polatlı
Sorgun
Serdivan
Gazipaşa
Kuşadası