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.
Connect to the consolidated database as a user with DBA authority.
In the left pane, select the Publications folder.
From the File menu, choose New » Publication.
In the What Do You Want To Name The New Publication field, type a name for the publication. Click Next.
Click Next.
In the Available Tables list, select a table. Click Add. Click Next.
On the Available Columns tab, double-click the table's icon to expand the list of Available Columns. Select 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.
Click Finish.
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.
See CREATE PUBLICATION statement [MobiLink] [SQL Remote].
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |