This statement is an extension to the ANSI/ISO standard for SQL.
.-PUBLIC--. >>-CREATE--+---------+--SYNONYM--synonym--FOR-------------------> '-PRIVATE-' >--+-table-----------+----------------------------------------->< +-view------------+ | (1) | '--------sequence-'
Element | Description | Restrictions | Syntax |
---|---|---|---|
sequence | Name of a local sequence | Must exist in the current database | Identifier |
table,
view |
Name of table or view for which synonym is being created | Must exist in the current database, or in a database specified in a qualifier | Database Object Name |
synonym | Synonym declared here for the name of a table, view, or sequence | Must be unique among table object names; see also Usage notes | Database Object Name |
Users have the same privileges for a synonym that they have for the database object that the synonym references. The syssynonyms, syssyntable, and systables system catalog tables maintain information about synonyms.
You cannot create a synonym for a synonym in the same database.
The identifier of the synonym must be unique among the names of tables, temporary tables, views, and sequence objects in the same database. (See, however, the section Synonyms with the Same Name.)
Once a synonym is created, it persists until the owner executes the DROP SYNONYM statement. (This persistence distinguishes a synonym from an alias that you can declare in the FROM clause of a SELECT statement; the alias is in scope only during execution of that SELECT statement.) If a synonym refers to a table, view, or sequence in the same database, the synonym is automatically dropped if the referenced table, view, or sequence object is dropped.
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]