Contents Index Receive data at the remote database A sample publication

SQL Remote User's Guide
  Tutorials for Adaptive Server Anywhere Users
    Start replicating data

Replicate from the remote database to the consolidated database


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

  1. Connect to the field database from Interactive SQL.

  2. 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')
  3. Commit the insertion by executing the following statement::

    COMMIT;
  4. 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"
  5. 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"
  6. 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.


Contents Index Receive data at the remote database A sample publication