Chapter 7. SQL Remote Design for Adaptive Server Anywhere

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;

...

The subscription argument is the location identifier.

In some circumstances it makes sense to add the KeyPool table to an existing publication and use the same argument to subscribe to each publication. Here we keep the location and rep_key values distinct to provide a more general solution.

See also

“CREATE PUBLICATION statement” [ASA SQL Reference, page 385]

“CREATE SUBSCRIPTION statement” on page 358

Filling and replenishing the key pool

Every time a user adds a new customer, their pool of available primary keys is depleted by one. The primary key pool table needs to be periodically replenished at the consolidated database using a procedure such as the following:

135

Page 153
Image 153
Sybase DC38133-01-0902-01 manual Filling and replenishing the key pool