In this lesson, you modify a synchronization model.
Prerequisites
This lesson assumes you have completed all preceding lessons. See Lesson 1: Designing the schemas.
This lesson assumes you have the roles and privileges listed in the Permissions and privileges section at the start of this tutorial: Tutorial: Using MobiLink with an Adaptive Server Enterprise consolidated database.
Right click the ase_remote_schema synchronization model and choose Properties.
Perform the following tasks:
In the first field, type sync_ase.
In the Publication name field, type sync_ase_publication.
In the Script version field, type sync_ase_scriptversion.
The publication is the object on the remote database that specifies what data is synchronized. MobiLink server scripts define how uploaded data from remotes should be applied to the consolidated database, and script versions group scripts. You can use different script versions for different applications, allowing you to maintain a single MobiLink server while synchronizing different applications.
Click Apply and then click OK.
Set the direction that data is synchronized for each table in the synchronization model.
Click the Mappings tab in the right pane, and set the rows in the Mapping Direction column as follows:
Filter the rows downloaded to the remote database by remote ID.
Select the row containing the stores table and then click the Download Subset tab.
Change the Download Subset to Custom.
Filter the rows by remote ID, which uniquely identifies the remote database, by adding a restriction to the WHERE clause of the download_cursor script.
Type a search condition in the SQL expression to use in the download cursor's WHERE clause field. For example, the following SQL script can be used for the stores table:
"dbo"."stores"."stor_id" = {ml s.remote_id} |
The download cursor script specifies what columns and rows are downloaded from each table to the remote database. The search condition ensures that you only download information about one store, namely, the store that has an identifier that equals the remote ID for the database.
Click the Download Delete Subset tab and change the Download Delete Subset from Same to None.
Repeat the previous step for the rows containing the sales, salesdetail, and discounts tables.
You must rename the table specified in the SQL script to the table name in the row that you are editing.
Use the following WHERE clause script for the sales table:
"dbo"."sales"."stor_id" = {ml s.remote_id} |
Use the following WHERE clause script for the salesdetail table:
"dbo"."salesdetail"."stor_id" = {ml s.remote_id} |
Use the following WHERE clause script for the discounts table:
"dbo"."discounts"."stor_id" = {ml s.remote_id} |
Save the synchronization model.
Click File » Save.
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0 |