If you create a synonym for a table or view that is not in the current database, and this table or view is dropped, the synonym stays in place. You can create a new synonym for the dropped table or view with the name of the dropped table or view as the synonym, which points to another external or remote table or view. (Synonyms for external sequence objects are not supported.)
In this way, you can move a table or view to a new location and chain synonyms together so that the original synonyms remain valid. (You can chain up to 16 synonyms in this manner.)
The following steps chain two synonyms together for the customer table, which will ultimately reside on the zoo database server (the CREATE TABLE statements are not complete):
CREATE TABLE customer (lname CHAR(15)...)
CREATE SYNONYM cust FOR stores_demo@training:customer
CREATE TABLE customer (lname CHAR(15)...)
DROP TABLE customer CREATE SYNONYM customer FOR stores_demo@zoo:customer
The synonym cust on the accntg database server now points to the customer table on the zoo database server.
The following steps show an example of chaining two synonyms together and changing the table to which a synonym points:
CREATE TABLE customer (lname CHAR(15)...)
CREATE SYNONYM cust FOR stores_demo@training:customer
DROP TABLE customer CREATE TABLE customer (lastname CHAR(20)...)
The synonym cust on the accntg database server now points to a new version of the customer table on the training database server.
Related statement: DROP SYNONYM .
For a discussion of concepts related to synonyms, see the IBM Informix Database Design and Implementation Guide.