In this lesson, you create the RemoteOrders table in the MobiLink consolidated database.
This lesson assumes you have completed all preceding lessons. See Lesson 1: Setting up a text file data source.
This lesson assumes that you have the roles and privileges listed in the Privileges section at the start of this tutorial: Tutorial: Using direct row handling.
Context and remarks
The RemoteOrders table you create contains the following columns:
order_id A unique identifier for orders.
product_id A unique identifier for products.
quantity The number of items sold.
order_status The order status.
last_modified The last modification date of a row. You use this column for timestamp-based downloads, a common technique used to filter rows for efficient synchronization.
Connect to your database from Interactive SQL.
You can start Interactive SQL from Sybase Central or at a command prompt.
To start Interactive SQL from Sybase Central, right-click the MLconsolidated - DBA database and click Open Interactive SQL.
To start Interactive SQL at a command prompt, run the following command:
dbisql -c "DSN=mldirect_db"
Execute the following SQL statement in Interactive SQL to create the RemoteOrders table.
CREATE TABLE RemoteOrders ( order_id INTEGER NOT NULL, product_id INTEGER NOT NULL, quantity INTEGER, order_status VARCHAR(10) DEFAULT 'new', last_modified TIMESTAMP DEFAULT CURRENT TIMESTAMP, PRIMARY KEY(order_id) );
Interactive SQL creates the RemoteOrders table in your consolidated database.
Execute the following statement in Interactive SQL to create MobiLink system tables and stored procedures.
Replace C:\Program Files\SQL Anywhere 16\ with the location of your SQL Anywhere 16 installation.
READ "C:\Program Files\SQL Anywhere 16\MobiLink\setup\syncsa.sql";
Interactive SQL applies syncsa.sql to your consolidated database. Running syncsa.sql creates a series of system tables and stored procedures prefaced with ml_. The MobiLink server works with these tables and stored procedures in the synchronization process.
Discuss this page in DocCommentXchange.
|Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0|