SQL Remote User's Guide
A Tutorial for Adaptive Server Enterprise Users
Start replicating data
You should now try entering data at the remote database and sending it to the consolidated database. Only the outlines are presented here.
To replicate data from the remote database to the consolidated database
Connect to the field database from Interactive SQL.
INSERT a row at the remote database. For example
INSERT INTO Customer (cust_key, name, rep_key) VALUES ('cust3', 'North Land Trading', 'rep1')
COMMIT the row.
COMMIT;
With the field.db database running, run dbremote to send the message to the consolidated database.
dbremote -c "eng=field;dbn=field;uid=DBA;pwd=SQL"
Run ssremote to receive the message at the consolidated database:
ssremote -c "eng=server-name;dbn=hq;uid=sa;pwd=sysadmin"
Connect to the consolidated database and display the Customer table. This now has three rows:
SELECT * FROM Customer
cust_key | name | rep_key |
---|---|---|
cust1 | Ocean Sports | rep1 |
cust2 | Sports Plus | rep2 |
cust3 | North Land Trading | rep1 |
In this simple example, there is no protection against duplicate entries of primary key values. SQL Remote does provide for such protection. For information, see the chapters on SQL Remote Design.