Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Remote » Tutorial: Creating a SQL Remote system

 

Lesson 7: Receiving data at the remote database

Receive the data on the remote database (field) that was sent from the consolidated database (hq).

Prerequisites

You must have the SYS_REPLICATION_ADMIN_ROLE system role.

Context and remarks

Many.

 Task
  1. If you are not currently connected to the remote database (field), run the following command:

    dbisql -c "UID=DBA;PWD=sql;SERVER=server_field;DBF=c:\tutorial\field.db"
    
  2. At the remote database (field) run the Message Agent from the c:\tutorial directory:

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

    The c:\tutorial\field\hq.0 file has been replaced by a file named c:\tutorial\hq\field.0. The field.0 file contains the receipt confirmation.

  4. Verify that the remote database (field) contains data,

    1. Execute the following statement to view the contents of the SalesReps table:

      SELECT * FROM SalesReps;

      The SalesReps table contains both rows entered at the consolidated database (hq). This is because the SalesRepData publication included all the data from the SalesReps table.

      rep_key name
      rep1 Field User
      rep2 Another User
      rep3 Example User
    2. Execute the following statement to view the contents of the Customers table:

      SELECT * FROM Customers;

      The Customers table now also contains a row with the Land Sports customer data that was entered at the consolidated database (hq).

      cust_key name rep_key
      cust1 Ocean Sports rep1
      cust3 Land Sports rep1
  5. 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"

    In the c:\tutorial\hq directory, the file field.0 disappears.

Results

The data that was sent from the consolidated database is received on the remote database.