Lesson 8: Sending data from the remote database to the consolidated database

In this lesson you send data from the remote database (field) to the consolidated database (hq).

 Replicate data from the remote database (field) to the consolidated database (hq) (Interactive SQL)
  1. If you are not currently connected to the remote database (field), run the following command:

    dbisql -c "UID=DBA;PWD=sql;SERVER=server_hq;DBF=c:\tutorial\field.db"
  2. Execute the following statement to insert a row at the remote database (field):

    INSERT INTO Customers ( cust_key, name, rep_key )
    VALUES ( 'cust5', 'North Land Trading', 'rep1' );
    COMMIT;
  3. From the c:\tutorial directory, run the dbremote utility against the remote database (field):

    dbremote -c "UID=DBA;PWD=sql;SERVER=server_field;DBF=c:\tutorial\field.db"

    In the c:\tutorial\hq directory, the file field.1 appears.

 Receive data at the consolidated database (hq)
  1. 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
    
  2. At the consolidated database (hq) run the Message Agent from the c:\tutorial directory:

    dbremote -c "UID=DBA;PWD=sql;SERVER=server_hq;DBF=c:\tutorial\hq.db"
  3. When the Message Agent window displays Execution Completed, click Shutdown.

  4. Browse to c:\tutorial\field.

    The hq.1 file has been replaced by a file named hq.2. The hq.2 file contains the receipt confirmation.

  5. Execute the following statement to view the data in the Customers table in the consolidated database (hq):

    SELECT * FROM Customers;

    This query returns the following results:

    cust_key name rep_key
    cust1 Ocean Sports rep1
    cust2 Sports Plus rep2
    cust3 Land Sports rep1
    cust4 Air Plus rep2
    cust5 North Landing Trading rep1