Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » MobiLink - Server Administration » MobiLink events » Synchronization events

upload_delete table event

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.

Parameters

In SQL scripts, you can specify event parameters by name or with a question mark. Using question marks has been deprecated. Use named parameters instead. 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 are going 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.

Not applicable
s. script_version VARCHAR(128). Optional IN parameter to specify that the MobiLink server passes the script version string used for the current synchronization to this parameter. Question marks cannot be used to specify this parameter. Not applicable

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

Default action

None.

Remarks

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, use direct row handling.

Note Conflict detection is usually performed much faster when done all at once in the upload_update script.
SQL example

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}' )