A data script that provides an event that the MobiLink server uses during processing of the upload to handle rows inserted into 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 inserted primary key column value, referenced by column name or column value. | 1 |
... | ... | ... |
r. pk-column-N | Required. The last inserted primary key column value, referenced by column name or column value. | N |
r. column-1 |
Required. The first inserted non-primary key column value, referenced by column name or column value. |
N+1 |
... | ... | ... |
r. column-M |
Required. The last inserted non-primary key column value, referenced by column name or column value. |
N+M |
None.
You can have one upload_insert 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.
This example handles inserts that were made on the Customer table in the remote database. The script inserts the values into a table named Customer in the consolidated database. The final column of the table identifies the Customer as active. The final column does not appear in the remote database.
CALL ml_add_table_script( 'ver1', 'Customer', 'upload_insert', 'INSERT INTO Customer( cust_id, name, rep_id, active ) VALUES ( {ml r.cust_id}, {ml r.name}, {ml r.rep_id}, 1 )' ); |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |