Use the following procedures to create a publication that uses a WHERE clause to include all the columns, but only some of the rows of a table. For information about using the WHERE clause and its alternative the SUBSCRIBE BY clause, see Publish only some rows in a table.
Use the SQL Anywhere 12 plug-in to connect to the consolidated database as a user with DBA authority.
In the left pane, click the Publications folder.
Click File » New » Publication.
In the What Do You Want To Name The New Publication field, type a name for the publication. Click Next.
In the Available Tables list, click a table. Click Add. Click Next.
On the Available Columns tab, double-click the table's icon to expand the list of Available Columns. Click each column you want to publish and click Add. Click Next.
On the Specify WHERE Clauses page:
Click a table in the Articles list.
Type a WHERE clause into the The Selected Article Has The Following WHERE Clause field.
Connect to the database as a user with DBA authority.
Execute a CREATE PUBLICATION statement that uses a WHERE clause to include the rows you want to include in the publication.
For example, the following statement creates a publication that publishes the ID, CompanyName, City, State, and Country columns of the Customers table, for customers marked as active in the Status column. The Status column is not published.
CREATE PUBLICATION PubCustomers ( TABLE Customers ( ID, CompanyName, City, State, Country ) WHERE Status = 'active' );
The following statements subscribe two employees to the same publication. Both Ann Taylor and Sam Singer receive the same data.
CREATE SUBSCRIPTION TO PubCustomers FOR Ann_Taylor; CREATE SUBSCRIPTION TO PubCustomers FOR Sam_Singer;
Users can subscribe to more than one publication, and can have more than one subscription to a single publication.
Discuss this page in DocCommentXchange.
|Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1|