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 - Client Administration » SQL Anywhere clients for MobiLink » Scripted upload » Tutorial: Using scripted upload

 

Lesson 2: Creating the remote database

In this lesson, you create a remote database and populate it with objects.

Prérequis

This lesson assumes you have the roles and privileges listed in the Privileges section at the start of this tutorial: Tutorial: Using scripted upload.

This lesson assumes you have completed all preceding lessons. See Lesson 1: Creating the consolidated database.

 Task
  1. At a command prompt in your samples directory, run the following command to create a remote database:

    dbinit -dba DBA,sql remote.db
  2. Next, run the following command to define an ODBC data source:

    dbdsn -w dsn_remote -y -c "UID=DBA;PWD=sql;DBF=remote.db;SERVER=remote"
  3. To open Interactive SQL and connect to remote.db using the dsn_remote, run the following command:

    dbisql -c "DSN=dsn_remote"
  4. Run the following set of statements to create objects in the remote database:

    First, create the table to be synchronized. The insert_time and delete_time columns are not synchronized but contain information used by the upload stored procedures to determine which rows to upload.

    CREATE TABLE employee (
         id            unsigned integer primary key,
         name          varchar( 256),
         salary        numeric( 9, 2 ),
         insert_time   timestamp default '1900-01-01'
    );

    After you have executed the SQL, leave Interactive SQL running and connected to the remote database as you will be running more SQL against the database as you work through the tutorial.

Résultat

The remote database is created.

Suivant

Proceed to Lesson 3: Handling inserts.