Subscribe to a publication

To subscribe a user to a publication, you need the following information:

  • User name   The user who is being subscribed to the publication. This user must have been granted REMOTE permission.

  • Publication name   The name of the publication to which the user is being subscribed.

  • Subscription value   The subscription value only applies if your publication includes a SUBSCRIBE BY clause. The subscription value is the value that is tested against the SUBSCRIBE BY clause of the publication. For example, if a publication has the name of a column containing an employee ID as a SUBCRIBE BY clause, the value of the employee ID of the subscribing user must be provided when the subscription is created. The subscription value is always a string.

    This value is only needed when the publication has a SUBSCRIBE BY clause. See Publish only some rows using the SUBSCRIBE BY clause.

To subscribe a user to the publication (Sybase Central)
  1. Connect to the database as a user with DBA authority.

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

  3. Select a publication.

  4. In the right pane, click the SQL Remote Subscriptions tab.

  5. From the File menu choose New » SQL Remote Subscription.

  6. Follow the instructions in the Create SQL Remote Subscription Wizard.

    The details of the subscription are different depending on whether the publication uses a subscription expression.

To subscribe a remote user to a publication (SQL)
  1. Connect to the database as a user with DBA authority.

  2. Execute a CREATE SUBSCRIPTION statement to subscribe a user to a publication.

    For example, the following statement creates a subscription for user name SamS to the CustomerPub publication, which was created using a WHERE clause:

    CREATE SUBSCRIPTION 
      TO CustomerPub
      FOR SamS;

    For example, the following statement creates a subscription for user name SamS to the PubOrders publication, defined with a subscription expression SalesRepresentative, requesting the rows for Sam Singer's own sales:

    CREATE SUBSCRIPTION 
      TO PubOrders ( '856' )
      FOR SamS;
See also