More than 400 tables in the Test Database need to be cleared repeatedly for testing. I can only use one entry in PL/SQL
Truncate Table1;
Truncate Table2;
Truncate table3;
Truncate table4;
......
Only one execution can be selected at a time. If multiple execution items are selected, an error can be returned. If you want to write a stored procedure or batch processing, You can execute the task when clearing the task.
Begin
For C in (select T. constraint_name, T. table_name
From user_constraints t
Where T. constraint_type = 'R') loop
Execute immediate 'alter table' | C. table_name | 'Disable constraint' | C. constraint_name;
End loop;
For C1 in (select table_name from user_tables) loop
Execute immediate 'truncate table' | c1.table _ name;
End loop;
For C2 in (select T. constraint_name, T. table_name
From user_constraints t
Where T. constraint_type = 'R') loop
Execute immediate 'alter table' | c2.table _ name | 'Enable constraint' | c2.constraint _ name;
End loop;
End;