A data script that provides an event that the MobiLink server uses during processing of the upload to handle rows deleted from the remote database.
In SQL scripts, you can specify event parameters by name or with a question mark. Using question marks has been deprecated and it is recommended that you use named parameters. 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 (deprecated for SQL) |
---|---|---|
s.remote_id |
VARCHAR(128). The MobiLink remote ID. You can only reference the remote ID if you are using named parameters. |
N/A |
s.username |
VARCHAR(128). The MobiLink user name. This parameter is optional. |
Optional |
r. pk-column-1 |
Required. The first deleted primary key column value, referenced by column name or column number. |
1 |
... | ... | ... |
r. pk-column-N |
Required. The last deleted primary key column value, referenced by column name or column number. |
N |
r. column-1 |
Required. The first deleted non-primary key column value, referenced by column name or column number. |
N + 1 |
... | ... | ... |
r. column-M |
Required. The last deleted non-primary key column value, referenced by column name or column number. |
N + M |
None.
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.
This script must be implemented in SQL. For Java or .NET processing of rows, see Direct row handling.
Conflict detection is usually performed much faster when done all at once in the upload_update script. See upload_update table event.
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.
CALL ml_add_table_script( 'ver1', 'Customer', 'upload_delete', 'UPDATE Customer SET active = 0 WHERE cust_id={ml r.cust_id}' ) |
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |