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 9: Setting the remote ID

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.

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.

Context and remarks

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

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

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

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

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

    • server   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.

Results

The database's remote ID to 5023, which is the value of the store identifier.

Next

Proceed to Lesson 10: Synchronizing.

 See also