Use this hook to implement custom logic to decide if a download file can be applied to the remote database. This hook is called only when a file-based download is applied.
Name | Value | Description |
---|---|---|
publication_n (in) |
publication |
Deprecated. Use subscription_n instead. The publications being synchronized, where n is an integer. There is one publication_n entry for each publication being synchronized. The n in publication_n and generation number_n match. The numbering of n starts at zero. |
MobiLink user (in) |
MobiLink user name |
The MobiLink user for which you are synchronizing. |
file last download time (in) |
The download file's last download time. (The download file contains all rows that were changed between its last download time and its next last download time.) |
|
file next last download time (in) |
The download file's next last download time. (The download file contains all rows that were changed between its last download time and its next last download time.) |
|
file creation time (in) |
The time when the download file was created. |
|
file generation number_n (in) |
number |
The generation numbers from the download file. There is one file generation number_n for each subscription_n entry. The n in subscription_n and generation number_n match. The numbering of n starts at zero. |
user data (in) |
string |
The string specified with the dbmlsync -be option when the download file was created or the DnldFileExtra synchronization profile option. |
apply file (in|out) |
True|False |
If true (the default), the download file is applied only if it passes dbmlsync's other validation checks. If false, the download file is not applied to the remote database. |
check generation number (in|out) |
True|False |
If true (the default), dbmlsync validates generation numbers. If the generation numbers in the download file do not match those in the remote database, dbmlsync does not apply the download file. If false, dbmlsync does not check generation numbers. |
setting generation number (in) |
true | false |
True if the -bg option or UpdateGenNum synchronization profile option was used when the download file was created. When true, the generation numbers on the remote database are updated from the download file and normal generation number checks are not performed. |
subscription_n (in) | subscription name(s) | The names of subscriptions being synchronized where n is an integer. This is one subscription_n entry for each subscription being synchronized. The numbering of n starts at zero. |
Use this stored procedure to implement custom checks to decide if a download file can be applied.
If you want to compare the generation numbers or timestamps contained in the file with those stored in the remote database, they can be queried from the SYSSYNC system view.
This hook is called before a file-based download is applied to the remote database.
The actions of this hook are committed immediately after it completes.
The following example prevents application of download files that don't contain the user string 'sales manager data'.
CREATE PROCEDURE sp_hook_dbmlsync_validate_download_file () BEGIN IF NOT exists(SELECT * FROM #hook_dict WHERE name = 'User data' AND value='sales manager data') THEN UPDATE #hook_dict SET value = 'false' WHERE name = 'Apply file'; END IF; END; |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |