Contents IndexCREATE PROCEDURE statement CREATE REMOTE MESSAGE TYPE statement

User's Guide
   Part VI. SQL Anywhere Reference
     Chapter 43. Watcom-SQL Statements
      CREATE PUBLICATION statement

Function

To create a publication for replication with SQL Remote.

Syntax

     CREATE PUBLICATION [ owner.]publication-name
          ...     ( TABLE article-description,... )

Parameters

     article-description:
          table-name [ ( column-name, ... ) ]
          ...     [ WHERE search-condition ]
          ...     [ SUBSCRIBE BY expression ]

Usage

Anywhere. This statement is applicable only to SQL Remote.

Permissions

Must have DBA authority. Requires exclusive access to all tables referred to in the statement.

Side effects

Automatic commit.

See also

Description

The CREATE PUBLICATION statement creates a SQL Remote publication in the database. A publication can be created for another user by specifying an owner name.

In SQL Remote, publishing is a two-way operation, as data can be entered at both consolidated and remote databases. In a SQL Remote installation, any consolidated database and all remote databases must have the same publication defined. Running the extraction utility from a consolidated database automatically executes the correct CREATE PUBLICATION statement in the remote database.

Article Publications are built from articles. Each article is a table or part of a table. An article may be a vertical partition of a table (a subset of the table's columns), a horizontal partition (a subset of the table's rows) or a vertical and horizontal partition.

SUBSCRIBE BY clause One way of defining a subset of rows of a table to be included in an article is to use a SUBSCRIBE BY clause. This clause allows many different subscribers to receive different rows from a table in a single publication definition.

WHERE clause The WHERE clause is a way of defining the subset of rows of a table to be included in an article. It is useful if the same subset if to be received by all subscribers to the publication.

You can combine WHERE and SUBSCRIBE BY clauses in an article definition.

Example

     CREATE PUBLICATION pub_contact (
     TABLE contact
     )

Contents IndexCREATE PROCEDURE statement CREATE REMOTE MESSAGE TYPE statement