MobiLink Synchronization Reference
Synchronization Events
Provides an event that the MobiLink synchronization server uses during processing of the upload stream to handle rows deleted from the remote database.
Item | Parameter |
---|---|
1 | primary key 1 |
2 | primary key 2 |
... | ... |
None.
The statement-based upload_delete script handles rows that are deleted in the remote database. The action taken at the consolidated database can be a DELETE statement, but need not be.
You can have one upload_delete 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 marks customers that are deleted from the remote database as inactive.
UPDATE Customer SET active = 0 WHERE cust_id=?
The following stored procedure call registers a Java method called uploadDeleteTable as the script for the upload_delete 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_delete', 'ExamplePackage.ExampleClass.uploadDeleteTable' )
Following is the sample Java method uploadDeleteTable. It dynamically generates an UPLOAD statement.
public string uploadDeleteTable() { return( genUD(_curTable) ); }
The following stored procedure call registers a .NET method called UploadDelete as the script for the upload_delete 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_delete', 'TestScripts.Test.UploadDelete' )
Following is the C# signature for the call UploadDelete.
public string UploadDelete( object pk1 )