SQL Remote User's Guide
Tutorials for Adaptive Server Anywhere 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 by executing the following statement:
INSERT INTO Customer (cust_key, name, rep_key) VALUES ('cust3', 'North Land Trading', 'rep1')
Commit the insertion by executing the following statement::
COMMIT;
With the field.db database running, run the dbremote utility from a command line to send the message to the consolidated database.
dbremote -c "dbn=field;uid=dba;pwd=sql"
With the hq.db database running, run the dbremote utility from a command line to receive the message at the consolidated database:
dbremote -c "dbn=hq;uid=dba;pwd=sql"
Connect to the consolidated database. Display the Customer table by executing the following statement:
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.