This lesson assumes you have completed all preceding lessons. See Lesson 1: Creating the consolidated database.
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';
Proceed to Lesson 8: Demonstrating the scripted upload.
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1|