Wednesday, April 28, 2010

PLSQL:handy script to truncate tables of your choice

declare
cursor cur_tables IS
select table_name from user_tables where table_name like 'EMP%';
begin
for c_rec in cur_tables LOOP
execute immediate 'truncate table '||c_rec.table_name;
end loop;
end;

No comments: