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 » MobiLink - Getting Started » MobiLink tutorials » Tutorial: Using MobiLink with an Adaptive Server Enterprise consolidated database


Lesson 6: Modify a synchronization model

In this lesson, you modify a synchronization model.


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.

  1. Right click the ase_remote_schema synchronization model and choose Properties.

  2. Perform the following tasks:

    1. In the first field, type sync_ase.

    2. In the Publication name field, type sync_ase_publication.

    3. 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.

    4. Click Apply and then click OK.

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

    • The sales and salesdetail tables should be set to Bi-directional (both upload and download).
    • The remaining tables should be set to Download to remote only.
  4. Filter the rows downloaded to the remote database by remote ID.

    1. Select the row containing the stores table and then click the Download Subset tab.

    2. Change the Download Subset to Custom.

    3. 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.

    4. Click the Download Delete Subset tab and change the Download Delete Subset from Same to None.

  5. 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}
  6. Save the synchronization model.

    Click File » Save.


The synchronization model is complete and ready for deployment.

 See also