求批量删除SQL表的游标语句,追加50分

来源:百度知道 编辑:UC知道 时间:2024/06/18 12:20:05
假如Master下面有100张表,
其中有50张表语句是aa开头的,要求执行一个语句,,可以把这50张表同时删掉
要详细点

汗,我也想要批量删除的语句!

declare
cursor c1 is
select 字段1 from tablename;
vname varchar2(40);
str_sql varchar2(2000);
begin
open c1;
fetch c1
into vname;
while c1%found loop
str_sql := 'drop table '||''||vname;
execute immediate str_sql;
fetch c1 into vname;
end loop;
close c1;
end;
/