批量删除ORACLE表存储过程
在管理
数据库的过程中经常要删除一些表,但是一个个的手工删除费时费力,写了下面一个存储过程,大家可以根据条件修改使用。
declare
Cursor cur is select table_name from all_tables where owner='XJG' AND TABLE_NAME LIKE 'XJG%';
rs cur%rowtype; www.2cto.com
begin
for rs in cur loop
begin
execute immediate 'drop table ' || rs.table_name;
dbms_output.put_line(rs.table_name);
end;
end loop;
end;
摘自 mails2008的专栏