Re: truncate tables in my tablespace
Date: Thu, 17 Jan 2008 21:06:45 GMT
> I want to delete all the data in all the tables in my tablespace.
> SQL> select table_name from user_tables;
> I can get a list of the tables but I dont want to a
> for each table type in
> SQL> delete from tablename;
> Is there a smart way of doing this?
In a nutshell:
select 'truncate table '||table_name||';' from dba_tables
where tablespace_name = 'USERS'
If you are not going to run the generated script as the table owner then add the owner. before the table name
hth Received on Thu Jan 17 2008 - 15:06:45 CST