end_upload connection event

Processes any statements just after the MobiLink server concludes processing uploaded inserts, updates, and deletes.

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.

Parameter name for SQL scripts

Description

Order

s.remote_id VARCHAR(128). The MobiLink remote ID. You can only reference the remote ID if you are using named parameters. Not applicable

s.username

VARCHAR(128). The MobiLink user name.

1

Default action

None.

Remarks

The MobiLink server executes this script as the last step in the processing of uploaded information. Upload information is processed in a single transaction. The execution of this script is the last action in this transaction before statistical scripts.

See also
SQL example

The following SQL Anywhere SQL script calls the EndUpload stored procedure.

CALL ml_add_connection_script(
 'ver1',
 'sales_order',
 'end_upload',
 'CALL EndUpload({ml username});' )
Java example

The following call to a MobiLink system procedure registers a Java method called endUploadConnection as the script for the end_upload connection event when synchronizing the script version ver1.

CALL ml_add_java_connection_script(
   'ver1',
   'end_upload',
   'ExamplePackage.ExampleClass.endUploadConnection' )

Following is the sample Java method endUploadConnection. It calls a method to perform operations on the database.

public String endUploadConnection( String user ) {
  // Clean up new and old tables.
  Iterator    two_iter = _tables_with_ops.iterator();
  while( two_iter.hasNext() ) {
    TableInfo cur_table = (TableInfo)two_iter.next();
    dumpTableOps( _sync_conn, cur_table ); 
  }
  _tables_with_ops.clear(); 
  return ( null );
}
.NET example

The following call to a MobiLink system procedure registers a .NET method called EndUpload as the script for the end_upload connection event when synchronizing the script version ver1.

CALL ml_add_dnet_connection_script(
  'ver1',
  'end_upload',
  'TestScripts.Test.EndUpload'
)

Following is the sample .NET method EndUpload. It returns a SQL statement that calls the EndUpload stored procedure.

public string EndUpload( string user ) {
  return ( "CALL EndUpload({ml username});" );
}