Mimer SQL User's Manual TOC PREV NEXT INDEX

Mimer Developer Site

www.mimer.com/developer


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 HOTELADM.ROOMS, HOTELADM.HOTEL, 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 ROOMS in the schema HOTELADM has the qualified name:

 HOTELADM.ROOMS
 

The ident called HOTELADM need only refer to it as:

 ROOMS
 

If another user wishes to use this table, he must refer to it by its fully qualified name since he does not have the same name as the schema to which the table belongs.

If a user named James, who wishes to refer to the ROOMS table, belonging to the schema HOTELADM, as simply ROOMS, he can create a synonym. In the following example, the schema name 'James' is implied by default (which must also have been created by user James if the CREATE is 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 ROOMS
 FOR HOTELADM.ROOMS;
 

Another user can then create his own synonym for the ROOMS synonym which now exists in schema 'James', which has the fully qualified name:

 JAMES.ROOMS


Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
dbtechnology@upright.se
Mimer SQL User's Manual TOC PREV NEXT INDEX