Processes statements related to a specific table just after the MobiLink server concludes preparing the stream of downloaded inserts, updates, and deletes.
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.last_table_download |
TIMESTAMP. The last download time for the table. |
1 |
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. |
2 |
s.table |
VARCHAR(128). The table name. |
3 |
None.
The MobiLink server executes this script after all rows have been downloaded and confirmation of receipt has been received. The download information is prepared in a separate transaction. The execution of this script is the last table-specific, non-statistical action in this transaction.
You can have one end_download script for each table in the remote database.
The end_download table event is used to perform whatever steps you need performed after downloading a particular table. The following SQL Anywhere SQL script drops a temporary table created by a prepare_for_download script to hold download rows for the sales_summary table.
CALL ml_add_table_script( 'MyCorp 1.0', 'sales_summary', 'end_download', 'DROP TABLE #sales_summary_download' ) |
The following call to a MobiLink system procedure registers a Java method called endDownloadTable as the script for the end_download table event when synchronizing the script version ver1.
CALL ml_add_java_table_script ( 'ver1', 'table1', 'end_download', 'ExamplePackage.ExampleClass.endDownloadTable' ) |
Following is the sample Java method endDownloadTable. It resets the current table member variable.
public String endDownloadTable( Timestamp ts, String user, String table ) { _curTable = null; return ( null ); } |
The following call to a MobiLink system procedure registers a .NET method called EndTableDownload as the script for the end_download table event when synchronizing the script version ver1 and the table table1.
CALL ml_add_dnet_table_script( 'ver1', 'table1', 'end_download', 'TestScripts.Test.EndTableDownload' ) |
Following is the sample .NET method EndTableDownload. It resets the current table member variable.
public string EndTableDownload DateTime timestamp, string user, string table ) { _curTable = null; return ( null ); } |
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |