Creating proxy tables (SQL)

You can create proxy tables in Interactive SQL using either the CREATE TABLE or CREATE EXISTING TABLE statement.

Prerequisites

You must have the CREATE PROXY TABLE system privilege to create proxy tables owned by you. You must have the CREATE ANY TABLE or CREATE ANY OBJECT system privilege to create proxy tables owned by others.

Task

The CREATE TABLE statement creates a new table on the remote server, and defines the proxy table for that table when you use the AT clause. Columns are defined using SAP Sybase IQ data types. SAP Sybase IQ automatically converts the data into the remote server's native types.

If you use the CREATE TABLE statement to create both a local and remote table, and then subsequently use the DROP TABLE statement to drop the proxy table, the remote table is also dropped. You can, however, use the DROP TABLE statement to drop a proxy table created using the CREATE EXISTING TABLE statement. In this case, the remote table is not dropped.

The CREATE EXISTING TABLE statement creates a proxy table that maps to an existing table on the remote server. SAP Sybase IQ derives the column attributes and index information from the object at the remote location.

  1. Connect to the host database.
  2. Execute a CREATE EXISTING TABLE statement.

The proxy table is created.

Related reference
CREATE EXISTING TABLE Statement
CREATE TABLE Statement