0

I am attempting to create synonyms for a user in Oracle.

BEGIN
    FOR S IN (SELECT owner, table_name FROM all_tables WHERE owner = 'TABLE_OWNER') LOOP
        EXECUTE IMMEDIATE 'create synonym '||S.table_name||' for '||S.owner||'.'||S.table_name||'';
    END LOOP;
END;

I get the following error in Toad when executed:

Error at line 1 ORA-00955: name is already used by an existing object ORA-06512: at line 3

Any thoughts?

4

1 回答 1

4

是的,表名和所有者以及同义词名称和所有者不能相同。可能只存在一个对象/所有者组合。您必须更改表名的同义词的所有者或名称。

于 2011-04-08T15:36:25.643 回答