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

 

Lesson 7: Creating a publication, MobiLink user, and subscription

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

 Create a publication, MobiLink user and subscription
  1. Using the instance of Interactive SQL connected to the consolidated database, run the following SQL statements. The publication called pub1 uses the scripted upload syntax (WITH SCRIPTED UPLOAD). It creates an article for the employee table, and registers the three stored procedures you just created for use in the scripted upload. It creates a MobiLink user called u1, and a subscription between v1 and pub1. The extended option FireTriggers is set to off to prevent triggers from being fired on the remote database when the download is applied, which prevents downloaded changes from being uploaded during the next synchronization.



    CREATE PUBLICATION pub1 WITH SCRIPTED UPLOAD (
    TABLE employee( id, name, salary ) USING (
       PROCEDURE employee_insert FOR UPLOAD INSERT, 
       PROCEDURE employee_update FOR UPLOAD UPDATE, 
       PROCEDURE employee_delete FOR UPLOAD DELETE 
          )
    );
    
    CREATE SYNCHRONIZATION USER u1;
    
    CREATE SYNCHRONIZATION SUBSCRIPTION TO pub1 FOR u1
    TYPE 'tcpip'
    ADDRESS 'host=localhost'
    OPTION FireTriggers='off'
    SCRIPT VERSION 'default';
  2. Proceed to Lesson 8: Demonstrating the scripted upload.