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

SQL Anywhere 10.0.1 » MobiLink - Server Administration » Writing Synchronization Scripts » Writing scripts to download rows

Writing scripts to download rows Next Page

Writing download_cursor scripts


You write download_cursor scripts to download information from the consolidated database to your remote database. You must write one of these scripts for each table in the remote database for which you want to download changes. You can use other scripts to customize the download process, but no others are necessary.

Example

The following script could serve as a download_cursor script for a remote table that holds employee information. The MobiLink server would use this SQL statement to define the download cursor. This script downloads information about all the employees.

SELECT emp_id, emp_fname, emp_lname
FROM employee

The MobiLink server passes specific parameters to some scripts. To use these parameters, you can use named parameters, or you can include a question mark in your SQL statement. In the latter case, the MobiLink server substitutes the value of the parameter before executing the statement against the consolidated database. The following script shows how you can use named parameters:

CALL ml_add_table_script( 
   'Lab',
   'ULOrder',
   'download_cursor',
   'SELECT o.order_id, o.cust_id, o.prod_id, o.emp_id, o.disc, o.quant, o.notes, o.status
         FROM ULOrder o
         WHERE o.last_modified >= {ml s.last_table_download}
               AND o.emp_name = {ml s.username}' )
Notes
See also