Chapter 4. Tutorials for Adaptive Server Anywhere Users

The Message Agent window displays status information while running. This information can be output to a log file for record keeping in a real setup. You will see that the Message Agent first receives a message from hq, and then sends a message. This return message contains confirmation of successful receipt of the replication update; such confirmations are part of the

SQL Remote message tracking system that ensures message delivery even in the event of message system errors.

Verify that the data has You should now connect to the remote field database using Interactive SQL,

arrivedand inspect the SalesRep and Customer tables, to see which rows have been received.

To verify that the data has arrived

1.Connect to the field database using Interactive SQL.

2.Inspect the SalesRep table by executing the following statement:

SELECT * FROM SalesRep

You will see that the SalesRep table contains both rows entered at the consolidated database. This is because the SalesRepData publication included all the data from the SalesRep table.

3. Inspect the Customer table by executing the following statement:

SELECT * FROM Customer

You will also see that the Customer table contains only row (Ocean Sports) entered at the consolidated database. This is because the SalesRepData publication included only those customers assigned to the subscribed Sales Rep.

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::

49

Page 67
Image 67
Sybase DC38133-01-0902-01 To verify that the data has arrived, Commit the insertion by executing the following statement