Data Replication with SQL Remote
PART 4. Reference
CHAPTER 17. Command Reference for Adaptive Server Anywhere
To create a publication for replication with SQL Remote.
CREATE PUBLICATION [ owner.]publication-name
... ( TABLE article-description,... )
article-description:
table-name [ ( column-name, ... ) ]
... [ WHERE search-condition ]
... [ SUBSCRIBE BY expression ]
Must have DBA authority. Requires exclusive access to all tables referred to in the statement.
Automatic commit.
The CREATE PUBLICATION statement creates a 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.
The following statement creates a simple publication:
CREATE PUBLICATION pub_contact ( TABLE contact )