end_upload_rows table event

Processes statements related to a specific table just after applying uploaded inserts and updates 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.

In SQL scripts, you can specify event parameters by name or with a question mark, but you cannot mix names and question marks within a script. If you use question marks, the parameters must be in the order shown below and are optional only if no subsequent parameters are specified (for example, you must use parameter 1 if you want to use parameter 2). If you use named parameters, you can specify any subset of the parameters in any order.

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

s.table

VARCHAR(128). The table name.

2

Default action

None.

Remarks

Uploaded information can require inserting or updating rows in the consolidated database. This script is run immediately after applying the changes that result from modifications to the remote table named in the second parameter.

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

See also
SQL Example

The following call to a MobiLink system procedure registers a SQL method called endUploadRows as the script for the EndUploadRows table event when synchronizing the script version ver1.

CALL ml_add_table_script(
  'version1',
  'table1',
  'end_upload_rows',
  'CALL EndUploadRows( 
      { ml s.username },
      { ml s.table } )' )

Following is the sample SQL method EndUploadRows. It calls a SQL method that manipulates the database.

CREATE PROCEDURE EndUploadRows (
 IN user VARCHAR(128)
 IN table VARCHAR{128} )
BEGIN
   CALL decide_what_to_do(table);
END;
Java example

The following call to a MobiLink system procedure registers a Java method called endUploadRows as the script for the end_upload_rows table event when synchronizing the script version ver1.

CALL ml_add_java_table_script(
   'ver1',
   'table1',
   'end_upload_rows',
   'ExamplePackage.ExampleClass.endUploadRows' )

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

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

The following call to a MobiLink system procedure registers a .NET method called EndUploadRows as the script for the end_upload_rows table event when synchronizing the script version ver1 and the table table1.

CALL ml_add_dnet_table_script(
  'ver1',
  'table1',
  'end_upload_rows',
  'TestScripts.Test.EndUploadRows'
)

Following is the sample .NET method endUploadRows. It calls a .NET method that manipulates the database.

public string EndUploadRows(
  string user,
  string table ) {
  processUploadedRows( _syncConn, table );
  return ( null );
}