-- Created on 2012-6-13 by ICD-LIHUAWEI
declare
type mytype is ref cursor;
tbsnames mytype;
tbsname varchar2(50);
sqltxt1 varchar2(500);
count1 int;
begin
open tbsnames for select table_name from user_tables where table_name like 'SHEB_STATIC%';
loop
fetch tbsnames into tbsname;
EXIT WHEN tbsnames%NOTFOUND OR tbsnames%NOTFOUND IS NULL;
select count(*) into count1 from cols where table_name=tbsname and column_name='BOUND_PERMITTED';
if(count1>0) then
sqltxt1:='alter table '|| tbsname||' drop column BOUND_PERMITTED';
EXECUTE IMMEDIATE sqltxt1;
end if;
end loop;
close tbsnames;
end;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/21179375/viewspace-732762/
,如需转载,请注明出处,否则将追究法律责任。