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.
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).
Choose a valid store identifier.
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.
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.
To exit isql, run the following command:
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.
Discuss this page in DocCommentXchange.
|Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0|