User's Manual
CREATE SUBSCRIPTION
TO pub_orders_samuel_singer
FOR SamS
Subscriptions with a
subscription expression
To subscribe a user to a publication, if that publication does have a
subscription expression, you need the following information:
♦ User ID The user who is being subscribed to the publication. This user
must have been granted remote permissions.
♦ Publication name The name of the publication to which the user is
being subscribed.
♦ Subscription value The value that is to be tested against the
subscription expression of the publication. For example, if a publication
has the name of a column containing an employee ID as a subscription
expression, the value of the employee ID of the subscribing user must be
provided in the subscription. The subscription value is always a string.
The following statement creates a subscription for Samuel Singer (user ID
SamS, employee ID 856) to the pub_orders publication, defined with a
subscription expression sales_rep, requesting the rows for Samuel Singer’s
own sales:
CREATE SUBSCRIPTION
TO pub_orders ( ’856’ )
FOR SamS
Starting a subscription In order to receive and apply updates properly, each subscriber needs to have
an initial copy of the data. The synchronization process is discussed in
“Synchronizing databases” on page 189.
☞ For more information, see “CREATE SUBSCRIPTION statement” on
page 358.
140