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

SQL Anywhere 12.0.1 » MobiLink - Getting Started » MobiLink tutorials » Tutorial: Using MobiLink with an Adaptive Server Enterprise consolidated database


Lesson 9: Setting the remote ID

This lesson assumes you have completed all preceding lessons. See Lesson 1: Designing the schemas.

In the remote schema, each remote database represents one store. The synchronization scripts you wrote include logic that instructs the MobiLink server to download a subset of data based on the remote ID of the remote database. You must set the database's remote ID to the value of a valid store identifier.

It is important to complete this step before the first synchronization because when the remote device synchronizes for the first time, it downloads all information related to the store (in this case, Thoreau Reading Discount Chain).

 Set the remote ID to a valid store identifier
  1. Choose a valid store identifier.

    1. Connect to the pubs2 database as sa, using iSQL in Adaptive Server Enterprise. At a command prompt, run the following command, all on one line:

      -U sa
      -P your-password-for-sa-account
      -D pubs2

      If you are accessing Adaptive Server Enterprise remotely, use the -S option to specify the server name.

    2. To view a list of valid store identifiers in the stores table, execute the following statement:

      SELECT * FROM stores

      In this tutorial, the remote database represents the Thoreau Reading Discount Chain store, which has a value of 5023 for its store identifier.

    3. To exit iSQL, run the following command:

  2. To set the database's remote ID to 5023, run the following command, all on one line:

        -c "SERVER=remote_eng;DBN=remote_db;UID=DBA;PWD=sql"
        "SET OPTION PUBLIC.ml_remote_id='5023'"
    • dbisql   is the application used to execute SQL commands against a SQL Anywhere database.

    • eng   specifies the database server name remote_eng.

    • dbn   specifies the database name remote_db.

    • uid   specifies the user name used to connect to your remote database.

    • pwd   specifies the password used to connect to your remote database.

    • SET OPTION PUBLIC.ml_remote_id='5023'   is the SQL command used to set the remote ID to 5023.

  3. Proceed to Lesson 10: Synchronizing.

 See also