Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements > CREATE SYNONYM >

Synonyms for Remote and External Tables and Views

A synonym can be created for any table or view in any database on your database server. This example declares a synonym for a table outside your current database, in the payables database of your current database server.

CREATE SYNONYM mysum FOR payables:jean.summary 

You can also create a synonym for a table or view that exists in a database of a database server that is not your current database server. Both database servers must be online when you create the synonym. In a network, the remote database server verifies that the table or view referenced by the synonym exists when you create the synonym. The next example creates a synonym for a table supported by a remote database server:

CREATE SYNONYM mysum FOR payables@phoenix:jean.summary 

The identifier mysum now refers to the table jean.summary, which is in the payables database on the phoenix database server. If the summary table is dropped from the payables database, the mysum synonym is left intact. Subsequent attempts to use mysum return the error: Table not found.

Dynamic Server, however, does not support synonyms for these external objects:

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]