Contents Index upload_cursor cursor event (deprecated) upload_fetch table event

MobiLink Synchronization Reference
  Synchronization Events

upload_delete table event


Function 

Provides an event that the MobiLink synchronization server uses during processing of the upload stream to handle rows deleted from the remote database.

Parameters 
Item Parameter
1 primary key 1
2 primary key 2
... ...
Default action 

None.

Description 

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.

See also 

upload_insert table event

upload_update table event

SQL example 

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=?
Java example 

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) ); }
.NET example 

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 )

Contents Index upload_cursor cursor event (deprecated) upload_fetch table event