Use the following procedure to create a publication using the SUBSCRIBE BY clause. For information about using the SUBSCRIBE BY clause and its alternative the WHERE 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.
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 SUBSCRIBE BY Restrictions page:
Click a table in the Articles list.
Click Column and choose a column from the dropdown list.
Connect to the database as a user with DBA authority.
Execute a CREATE PUBLICATION statement that includes a SUBSCRIBE BY clause.
The following statement creates a publication that publishes the ID, CompanyName, City, State, and Country columns of the Customers table and to match the rows with subscribers uses the value of the State column:
CREATE PUBLICATION PubCustomers ( TABLE Customers ( ID, CompanyName, City, State, Country ) SUBSCRIBE BY State );
The following statements subscribe two employees to the publication. Ann Taylor receives the customers in Georgia (GA), and Sam Singer receives the customers in Massachusetts (MA).
CREATE SUBSCRIPTION TO PubCustomers ( 'GA' ) FOR Ann_Taylor; CREATE SUBSCRIPTION TO PubCustomers ( 'MA' ) FOR Sam_Singer;
Users can subscribe to more than one publication, and can have more than one subscription to a single publication.
|Envoyer votre avis sur cette page par email.||Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1|