MobiLink Synchronization Reference
Synchronization Events
Provides an event that the MobiLink synchronization server uses during processing of the upload stream to handle rows updated at the remote database.
Clause | Parameters |
---|---|
SET |
column 11
column 22 ... |
WHERE |
primary key 1
primary key 2 ... |
None.
The statement-based upload_update script performs direct update of column values as specified in the upload_update statement.
The WHERE clause must include all of the primary key columns that are being synchronized. The SET clause must contain all of the non-primary key columns that are being synchronized.
You use as many non-primary key columns in your SET clause as exist in the table, and MobiLink will send the correct number of column values. Similarly, in the WHERE clause, you can have any number of primary keys, but all must be specified here, and MobiLink will send the correct values. MobiLink sends these column values and primary key values in the order the columns or primary keys appear in a MobiLink report of your schema. You can use the -vh option to determine the column ordering for this table schema.
You can have one upload_update script for each table in the remote database.
For Java and .NET applications, this script must return valid SQL.
This example is taken from the Contact sample and can be found in Samples\MobiLink\Contact\build_consol.sql. It handles updates made to the Customer table in the remote database. The script updates the values in a table named Customer in the consolidated database.
UPDATE Customer SET name=?, rep_id=? WHERE cust_id=?
The following stored procedure call registers a Java method called uploadUpdateTable as the script for the upload_update table event when synchronizing the script version ver1. This syntax is for Adaptive Server Anywhere consolidated databases.
call ml_add_java_table_script( 'ver1', 'table1', 'upload_update', 'ExamplePackage.ExampleClass.uploadUpdateTable' )
Following is the sample Java method uploadUpdateTable. It dynamically generates an UPLOAD statement.
public string uploadUpdateTable() { return( genUU(_curTable) ); }
The following stored procedure call registers a .NET method called UploadUpdate as the script for the upload_update table event when synchronizing the script version ver1 and the table table1. This syntax is for Adaptive Server Anywhere consolidated databases.
call ml_add_dnet_table_script( 'ver1', 'table1', 'upload_update', 'TestScripts.Test.UploadUpdate' )
Following is the C# signature for the call UploadUpdate.
public string UploadUpdate()