User's Manual
❖ To create the publication
1. Connect to the database from Interactive SQL, and execute the following
statement:
CREATE PUBLICATION SalesRepData (
TABLE SalesRep,
TABLE Customer SUBSCRIBE BY rep_key
)
Set up a subscription Each user ID that is to receive changes to the publication must have a
subscription. The subscription can only be created for a user who has
REMOTE permissions. The GRANT REMOTE statement contains the
address to use when sending the messages.
❖ To create the subscription
1. Connect to the database from Interactive SQL, and execute the following
statement:
CREATE SUBSCRIPTION
TO SalesRepData (’rep1’)
FOR field_user ;
The value rep1 is the rep_key value we will give to the user field_user in
the SalesRep table.
The full CREATE SUBSCRIPTION statement allows control over the data
in subscriptions; allowing users to receive only some of the rows in the
publication. For more information, see “CREATE SUBSCRIPTION
statement” on page 358.
The CREATE SUBSCRIPTION statement identifies the subscriber and
defines what they receive. However, it does not synchronize data, or start the
sending of messages.
Set up the remote database
The remote database needs to be configured in order to send and receive
messages and participate in a SQL Remote setup. Like the consolidated
database, the remote database needs a CURRENT PUBLISHER to identify
the source of outgoing messages, and it needs to have the consolidated
database identified as a subscriber. The remote database also needs the
publication to be created and needs a subscription created for the
consolidated database. The remote database also needs to be synchronized
with the consolidated database; that is, it needs to have a current copy of the
data in order for the replication to start.
44