oracle pl/sql 创建同义词

CREATE OR REPLACE Procedure Create_Synonym Authid Current_User Is
  Sun Varchar2(1000);
  i   Number;
Begin
  For i In (Select Table_Name From Dba_Tables Where Owner = 'NEWWSS') Loop
    Begin
      Sun := i.Table_Name;
      Execute Immediate 'create or replace synonym WSS_' || Sun ||
                        ' for NEWWSS.' || Sun || '@WSS_LINK.US.ORACLE.COM';
    Exception
      When Others Then
        Null;
    End;
  End Loop;
End Create_Synonym;

你可能感兴趣的:(Oracle)