Create the publication on the consolidated database using Interactive SQL.
You must have the SYS_REPLICATION_ADMIN_ROLE system role.
Context and remarks
A publication describes the set of data to be replicated. In this lesson you create a publication named SalesRepData that replicates all rows of the SalesReps table, and some rows of the Customers table. You subscribe a user to a publication by creating a subscription.
If you are not currently connected to the consolidated database (hq), run the following command:
dbisql -c "UID=DBA;PWD=sql;SERVER=server_hq;DBF=c:\tutorial\hq.db"
Execute the following statement to create a publication named SalesRepData:
CREATE PUBLICATION SalesRepData ( TABLE SalesReps, TABLE Customers SUBSCRIBE BY rep_key );
The SalesRepData publication publishes:
The entire SalesReps table
All of the columns in the Customers table but only the rows that match a specified rep_key value
Execute the following statement to create a subscription to SalesRepData:
CREATE SUBSCRIPTION TO SalesRepData ('rep1') FOR field_user;
The value rep1 is the rep_key value for the user Field User in the SalesReps table.
In this tutorial, there is no protection against duplicate entries of primary key values. For information, see Creating SQL Remote systems.
Discuss this page in DocCommentXchange.
|Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0|