Contents Index Writing scripts to download rows Writing download_delete_cursor scripts

MobiLink Synchronization User's Guide
  Writing Synchronization Scripts
    Writing scripts to download rows

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 synchronization 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 synchronization server passes specific parameters to some scripts. To use these parameters, you include a question mark in your SQL statement. The MobiLink synchronization server substitutes the value of the parameter before executing the statement against the consolidated database. The following script shows how you can use these 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 >= ?
AND o.emp_name = ?' )

In this example, the MobiLink synchronization server replaces the question mark with the value of the parameter to the download_cursor script.

Notes 

Contents Index Writing scripts to download rows Writing download_delete_cursor scripts