Publish only some rows using the SUBSCRIBE BY clause

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.

To create a publication using the SUBSRIBE BY clause (Sybase Central)
  1. Connect to the consolidated database as a user with DBA authority.

  2. In the left pane, select the Publications folder.

  3. From the File menu, choose New » Publication.

  4. In the What Do You Want To Name The New Publication field, type a name for the publication. Click Next.

  5. Click Next.

  6. In the Available Tables list, select a table. Click Add. Click Next.

  7. 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.

  8. Click Next.

  9. On the Specify SUBSCRIBE BY Restrictions page:

    1. Click a table in the Articles list.

      Click Column and choose a column from the dropdown list.

  10. Click Finish.

To create a publication using the SUBSRIBE BY clause (SQL)
  1. Connect to the database as a user with DBA authority.

  2. Execute a CREATE PUBLICATION statement that includes a SUBSCRIBE BY clause.

    For example

    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.

See also