Sybase SQL Remote DC38133-01-0902-01 User Manual

Page of 485
Chapter 8. SQL Remote Design for Adaptive Server Enterprise
Creating subscriptions
To subscribe to a publication, each subscriber must be granted REMOTE
permissions and a subscription must also be created for that user. The details
of the subscription are different depending on whether or not the publication
uses a subscription column.
Subscriptions with no
subscription column
To subscribe a user to a publication, if that publication has no subscription
column, 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.
The following statement creates a subscription for a user ID SamS to the
pub_orders_samuel_singer publication, which was created without using a
subscription column:
sp_subscription ’create’,
’pub_orders_samuel_singer’,
’SamS’
Subscriptions with a
subscription column
To subscribe a user to a publication, if that publication does have a
subscription column, 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 column of the publication. For example, if a publication has
the name of a column containing an employee ID as a subscription
column, 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 column sales_rep, requesting the rows for Samuel Singer’s own
sales:
sp_subscription create,
pub_orders,
SamS,
’856’
181