|
|
Creating Synonyms
Synonyms, or alternative names can be created for tables, views or other synonyms. You can create synonyms to personalize tables or just for your own convenience. Synonym names can be made up of a maximum of 128 characters.
Table names are `qualified' by the name of the schema to which they belong. The qualified form of the table name is the schema name followed by the table name and the two are separated by a period.
Synonyms are particularly useful when several users refer to a common table, such as
MIMER_STORE.ITEMS,MIMER_STORE.CURRENCIES, etc. With synonyms, several users can work in the same apparent environment without needing to refer to the tables by their qualified names.Synonym Examples
The table
ITEMSin the schemaMIMER_STOREhas the qualified name:MIMER_STORE.ITEMSThe ident called
MIMER_STOREneed only refer to it as:ITEMSIf other users wish to use this table, they must refer to it by its fully qualified name since they do not have the same name as the schema to which the table belongs.
If a user named
JAMES, who wishes to refer to theITEMStable, belonging to the schemaMIMER_STORE, as simplyITEMS, he can create a synonym.In the following example, the schema name
JAMESis implied by default (which must also have been created by userJAMESif theCREATEis to succeed) because the synonym name is specified in its unqualified form (and the default schema name is the name of the current ident):CREATE SYNONYM items FOR mimer_store.items;Another user can then create his own synonym for the
ITEMSsynonym that now exists in schema 'JAMES', which has the fully qualified name:JAMES.ITEMS
|
Mimer Information Technology AB Voice: +46 18 780 92 00 Fax: +46 18 780 92 40 info@mimer.se |
|
|