In this lesson you send data from the remote database (field) to the consolidated database (hq).
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" |
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; |
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.
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 |
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" |
When the Message Agent window displays Execution Completed
, click Shutdown.
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.
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 |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |