How to drop all the tables using one SQL query?
There is no DROP ALL TABLES command. So this cannot be done with one SQL statement. The easiest way to do this is to generate your DROP TABLE commands on the fly, similar to the following:
SPOOL drop_tables.sql SELECT 'DROP TABLE '||table_name||';' FROM user_tables; SPOOL OFF @drop_tables
The drop_tables.sql script is dynamically generated for all tables in your schema.
Dig Deeper on Oracle and SQL
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.