Alex Rivera | Logout

SQL: delete all the data from all available tables

Asked 2009-05-06T22:41:40.327
28

I am using oracle DB to maintain more than 30 tables, how can I delete all the data from all the tables? I only want to delete the data but not drop the tables.

Edit
Report

1 Answer

33

Generate a script to truncate (= remove all rows from) all tables:

select 'truncate table ' || table_name || ';' from user_tables

And then execute the script.

answered 2009-05-06T22:48:20.313

Your Answer