6/16/2013

Deleting all tables in ORACLE

This is how you delete all tables in an oracle database (maybe using the Oracle SQL Developer). This can come in handy when you don´t want to drop your schema.
begin
  for rec in (select object_name from user_objects where object_type = 'TABLE') 
  loop
    execute immediate 'drop table ' || rec.object_name;
  end loop;
end;
If you like this post it would be very nice, if you could click on some of the google ads you see on the right side. It helps me run this block and motivates me ;)

If you have any questions, feel free to leave a comment.