日期:2014-05-16  浏览次数:20442 次

创建同义词样例
create or replace procedure synonym_procedure
AS
i_count integer;
begin
select count(*) into i_count from user_objects t where t.OBJECT_TYPE ='SYNONYM' and t.OBJECT_NAME = upper('synonym_name');
    if i_count>0 then
        EXECUTE IMMEDIATE 'drop synonym synonym_name';
    end if;

end synonym_procedure;
/
call synonym_procedure();
drop procedure synonym_procedure;

create or replace synonym 'synonym_name'
for abc.def;