SQL$HELP72.HLB  —  ALTER  SYNONYM  Examples
    Example 1: Adding a Comment

    SQL> ALTER SYNONYM CASH
    cont>   COMMENT IS 'use a different name to avoid confusion with'
    cont>   /          'the domain MONEY';

    Example 2: Using Multiple Synonyms and Changing the Referenced
    Table Using ALTER

    The following example uses a synonym to reference a table. Later
    an empty version of the table can be created and the synonym
    altered to reference this new table. Although similar to using a
    view definition, the use of synonyms avoid the usage locking of
    a view. That is, to drop and create a new view requires that no
    other user references that view, however, the alter synonym does
    not require exclusive access to the table.

    SQL> CREATE TABLE t_employees_0001 (...);
    SQL> CREATE SYNONYM employees FOR t_employees_0001;
    SQL> CREATE SYNONYM emps FOR employees;
    SQL> CREATE TABLE t_employees_0002 LIKE t_employees_0001;
    SQL> ALTER SYNONYM employees FOR t_employees_0002;
Close Help