Contents Index end_upload table event end_upload_rows table event

MobiLink Synchronization Reference
  Synchronization Events

end_upload_deletes table event


Function 

Processes statements related to a specific table just after applying deletes uploaded from the specified table in the remote database.

Parameters 

In the following table, the description provides the SQL data type. If you are writing your script in Java or .NET, you should use the appropriate corresponding data type. See SQL-Java data types and SQL-.NET data types.

Event parameters are optional only if no subsequent parameters are specified. You must use parameter 1 if you want to use parameter 2.

Item Parameter Description
1 ml_username VARCHAR(128)
2 table VARCHAR(128)
Default action 

None.

Description 

This script is run immediately after applying the changes that result from rows deleted in the remote table named in the second parameter.

You can have one end_upload_deletes script for each table in the remote database.

See also 

begin_upload_deletes table event

SQL example 

You can use this event to process rows deleted during the upload stream on an intermediate table. You can compare the rows in the base table with rows in the intermediate table and decide what to do with the deleted row.

Call ml_add_table_script(
  'version1',
  'Leads',
  'end_uploads_deletes',
  'call EndUploadDeletesLeads()');
Create procedure EndUploadDeletesLeads ( )
Begin
  FOR names AS curs CURSOR FOR
  SELECT LeadID
    FROM Leads
    WHERE LeadID NOT IN (SELECT LeadID FROM T_Leads);
  DO
   CALL decide_what_to_do( LeadID );
  END FOR;
end
Java example 

The following stored procedure call registers a Java method called endUploadDeletes as the script for the end_upload_deletes 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',
   'end_upload_deletes',
   'ExamplePackage.ExampleClass.endUploadDeletes' )

Following is the sample Java method a endUploadDeletes. It calls a Java method that manipulates the database.

public String endUploadDeletes( String user,
String table )
  throws java.sql.SQLException
{  processUploadedDeletes( _syncConn, table );
   return( null ); }
.NET example 

The following stored procedure call registers a .NET method called EndUploadDeletes as the script for the end_upload_deletes 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',
   'end_upload_deletes',
   'TestScripts.Test.EndUploadDeletes'
)

Following is the C# signature for the call EndUploadDeletes.

public void EndUploadDeletes( string user, string table )

Contents Index end_upload table event end_upload_rows table event