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

SQL Anywhere 11.0.1 (Français) » MobiLink - Server Administration » MobiLink Events » Writing synchronization scripts

 

Writing scripts to upload rows

To inform the MobiLink server on how to process the upload stream data received from the remote databases, you define upload scripts. You write separate scripts to handle rows that are updated, inserted, or deleted at the remote database. A simple implementation would perform corresponding actions (update, insert, delete) at the consolidated database.

The MobiLink server uploads data in a single transaction. For a description of the upload process, see Events during upload.

For techniques for uploading rows in .NET synchronization logic, see Uploading or downloading rows.

Notes
  • The begin_upload and end_upload scripts for each remote table hold logic that is independent of the individual rows being updated.

  • The upload consists of single row inserts, updates, and deletes. These actions are typically performed using upload_insert, upload_update, and upload_delete scripts.

  • To prepare the upload for SQL Anywhere clients, the dbmlsync utility requires access to all transaction logs written since the last successful synchronization. See Transaction log files.

  • When synchronizing a remote database using MobiLink client version 9.0 or earlier, or when using question marks instead of named parameters as placeholders in upload_insert, upload_new_row_insert, or upload_old_row_insert events, the MobiLink server uses the column order of the table as it is defined in the remote database. The column order in the event statement must match the column order as it is defined in the remote database but table and column names in the consolidated database can be different from those in the remote database.

    The following is an INSERT statement used only when emp_name is defined before emp_id in the remote database.

    INSERT INTO emp (emp_name, emp_id)
    VALUES (?, ?);

Writing upload_insert scripts
Writing upload_update scripts
Writing upload_delete scripts
Writing upload_fetch scripts