Collection Contents Index CREATE DOMAIN statement CREATE EXTERNLOGIN statement pdf/chap9.pdf

Reference Manual
   CHAPTER 9. SQL Statements     

CREATE EXISTING TABLE statement


Function 

To create a new proxy table representing an existing object on a remote server.

Syntax 

CREATE EXISTING TABLE [owner.]table_name
[(column-definition, ...)]
AT 'location-string'

Parameters 

column-definition:
column-name data-type [NOT NULL]

location-string:
remote-server-name.[db-name].[owner].object-name
| remote-server-name;[db-name];[owner];object-name

Permissions 

Must have RESOURCE authority. To create a table for another user, you must have DBA authority.

Supported on Windows 95 and Windows NT only.

Side effects 

Automatic commit.

See also 

CREATE TABLE statement

Description 

The CREATE EXISTING TABLE statement creates a new local, proxy table that maps to a table at an external location. The CREATE EXISTING TABLE statement is a variant of the CREATE TABLE statement. The EXISTING keyword is used with CREATE TABLE to specify that a table already exists remotely and that its metadata is to be imported into Adaptive Server Anywhere. This establishes the remote table as a visible entity to Adaptive Server Anywhere users. Adaptive Server Anywhere verifies that the table exists at the external location before it creates the table.

If the object does not exist (either host data file or remote server object), the statement is rejected with an error message.

Index information from the host data file or remote server table is extracted and used to create rows for the system table sysindexes. This defines indexes and keys in server terms and enables the query optimizer to consider any indexes that may exist on this table.

Referential constraints are passed to the remote location when appropriate.

If column-definitions are not specified, Adaptive Server Anywhere derives the column list from the metadata it obtains from the remote table. If column-definitions are specified, Adaptive Server Anywhere verifies the column-definitions. Column names, data types, lengths, identity property, and null properties are checked for the following:

Standards and compatibility 

Examples 


Collection Contents Index CREATE DOMAIN statement CREATE EXTERNLOGIN statement pdf/chap9.pdf