Contents Index A simple synchronization script Generating example scripts

MobiLink Synchronization User's Guide
  Writing Synchronization Scripts
    Introduction to synchronization scripts

Generating scripts automatically


You can use the dbmlsrv9 -za option to generate default synchronization scripts. The synchronization scripts perform a snapshot synchronization of your consolidated database with your remote database using table and column names that are sent from the client.

To use this feature with Adaptive Server Anywhere clients, set the SendColumnNames extended option to ON to cause dbmlsync to send the column names with the upload header. To use this feature with UltraLite clients, set the send_column_names parameter to ul_true.

When you use -za, scripts are generated the first time that a remote synchronizes with a script version that doesn't exist. If the given script version already exists, -za has no effect. This means that you cannot use -za to generate scripts one table at a time for the same script version. Using -za, you must generate scripts for all tables and publications at once.

For more information, see -za option.

Example 

Start the MobiLink synchronization server using the -za switch. For example, type:

dbmlsrv9 -c "dsn=YourDBDSN" -za

Run dbmlsync and set the SendColumnNames extended option to ON. For example, type:

dbmlsync -c dsn=dsn_remote -e "SendColumnNames=ON"

Scripts are generated for all tables specified in the publication. On synchronization, these automatically-generated scripts control the upload and download of data to and from your client and consolidated databases. The following table describes these scripts for the emp table.

Script name Script contents
upload_insert
INSERT INTO emp (emp_id, emp_name)
VALUES (?,?)
upload_update
UPDATE emp SET emp_name=?
WHERE emp_id=?
upload_delete
DELETE FROM emp
WHERE emp_id=?
download_cursor
SELECT emp_id, emp_name FROM emp

Generating example scripts
Example scripts for UltraLite

Contents Index A simple synchronization script Generating example scripts