Synonyms for objects outside the current database
A synonym can be created for any table or view in any database of the database server to which your session is currently connected.
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 an external table that the CREATE EXTERNAL TABLE statement registered in the current database. (The external table is registered in the system catalog of the database where it was created, but it is not stored in any database.)
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 in a database of 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
.
HCL
OneDB™,
however, does not support synonyms for these table objects :
- Typed tables (including any table that is part of a table hierarchy)
- Tables or views with columns of any extended data types
- Sequence objects outside the local database