Chapter 7. SQL Remote Design for AdaptiveSer verAnywhere
2. Create subscriptions for each remote database to the KeyPoolData
publication.
CREATE SUBSCRIPTION
TO KeyPoolData( ’user1’ )
FOR user1;
CREATE SUBSCRIPTION
TO KeyPoolData( ’user2’ )
FOR user2;
...
Thesubscription argument is the location identifier.
Insome circumstances it makes sense to add the KeyPool table to an existing
publicationand use the same argument to subscribe to each publication.
Herewe keep the location and rep_key values distinct to provide a more
generalsolution.
Seealso
“CREATEPUBLICATION statement” [ASA SQL Reference,page 385]
“CREATESUBSCRIPTION statement” on page 358
Filling and replenishing the key pool
Everytime a user adds a new customer, their pool of available primary keys
isdepleted by one. Theprimary key pool table needs to be periodically
replenishedat the consolidated database using a procedure such as the
following:
135