Contents Index ml_add_java_table_script sp_hook_dbmlsync_abort

MobiLink Synchronization Reference
  Stored Procedures

Client event-hook procedures


The following stored procedures provide the interface for customizing synchronization at Adaptive Server Anywhere clients.

Notes 
The #hook_dict table  

Immediately before a hook is called, dbmlsync creates the #hook_dict table in the remote database, using the following CREATE statement. The # before the table name means that the table is temporary.

CREATE TABLE #hook_dict(
name VARCHAR(128) NOT NULL UNIQUE,
value VARCHAR(255) NOT NULL)

dbmlsync uses the #hook_dict table to pass values to hook functions, and hook functions use the #hook_dict table to pass values back to dbmlsync.

For example, for the following dbmlsync command line,

dbmlsync -c 'dsn=MyDsn' -n pub1,pub2 -u MyUser

when the sp_hook_dbmlsync_abort hook is called, the #hook_dict table will contain the following rows:

Name Value
publication_0
pub1
publication_1
pub2
MobiLink user
MyUser
Abort synchronization
false

Your abort hook can retrieve values from the #hook_dict table and use them to customize behavior. For example, to retrieve the MobiLink user you would use a SELECT statement like this:

SELECT value
FROM #hook_dict
WHERE name = 'MobiLink user'

In/out parameters can be updated by your hook to modify the behavior of dbmlsync. For example, your hook could instruct dbmlsync to abort synchronization by updating the abort synchronization row of the table using a statement like this:

UPDATE #hook_dict
SET value='true'
WHERE name='abort synchronization'

The description of each hook lists the rows in the #hook_dict table.


sp_hook_dbmlsync_abort
sp_hook_dbmlsync_begin
sp_hook_dbmlsync_delay
sp_hook_dbmlsync_download_begin
sp_hook_dbmlsync_download_com_error
sp_hook_dbmlsync_download_end
sp_hook_dbmlsync_download_fatal_sql_error
sp_hook_dbmlsync_download_log_ri_violation
sp_hook_dbmlsync_download_ri_violation
sp_hook_dbmlsync_download_sql_error
sp_hook_dbmlsync_download_table_begin
sp_hook_dbmlsync_download_table_end
sp_hook_dbmlsync_end
sp_hook_dbmlsync_log_rescan
sp_hook_dbmlsync_logscan_begin
sp_hook_dbmlsync_logscan_end
sp_hook_dbmlsync_process_return_code
sp_hook_dbmlsync_schema_upgrade
sp_hook_dbmlsync_upload_begin
sp_hook_dbmlsync_upload_end
sp_hook_dbmlsync_validate_download_file

Contents Index ml_add_java_table_script sp_hook_dbmlsync_abort