Delete the data from All tables in Oracle
In this case I need to delete all the Data in my tables because I'm making test of upload all the Data, and I'm too lazy to delete all the tables and create them again, so I'll show you a way to delete all the data First you need to disable all the constraints, or at least foreign keys, if you don't do it, you can get an error unless you delete the tables in the right order. watch this post to disable them.
Disable and Enable All table constraints in Oracle
Now that you have disabled all the constraints, run the next pl/sql block that will delete all the data in all the tables. and as you don't have constraints, you will not get errors
begin
for r in (select table_name from user_tables) LOOP
execute immediate('delete '||r.table_name);
END LOOP;
end;
Comments
Post a Comment