日期:2014-05-17  浏览次数:21059 次

oracle批量删除同义词问题
麻烦问下用oracle怎么批量删除相同前后缀的同义词啊?
我用 drop sysnonym where sysnoym_name like '%11010%'; 不行啊

------解决方案--------------------
SQL code

begin
for v_synonym_name in
(select synonym_name from user_synonyms where synonym_name like '%110110%') loop
execute immediate 'drop synonym '||v_synonym_name.synonym_name;
--dbms_output.put_line('drop synonym '||v_synonym_name.synonym_name);
end loop;
end;

------解决方案--------------------
先将要删除的同义词用查询语句拼接出来,然后拷贝出来执行就行了吧
------解决方案--------------------
探讨
麻烦问下用oracle怎么批量删除相同前后缀的同义词啊?
我用 drop sysnonym where sysnoym_name like '%11010%'; 不行啊