Using the create existing table command

The create existing table command allows the definition of existing tables (proxy tables). The syntax for this option is similar to the create table command and reads as follows:

create existing table table_name (column_list) 
 [ on segment_name ]
[[external {table | procedure | file}] at pathname] 

The action taken by the server when it receives this command is quite different from the action it takes when it receives the create table command, however. In this case, a new table is not created at the remote location; instead, the table mapping is checked, and the existence of the underlying object is verified. If the object does not exist (either host data file or remote server object), the command is rejected with an error message.

If the object does exist, its attributes are obtained and used to update system tables sysobjects, syscolumns, and sysindexes.

After successfully defining an existing table, issue an update statistics command for the table.This allows the query optimizer to make intelligent choices regarding index selection and join order.