Contents Index Forced conflict resolution Data entry

MobiLink Synchronization User's Guide
  Synchronization Techniques
    Handling conflicts

Storing the user name


When you write upload_old_row_insert or upload_new_row_insert scripts, you can include an extra column in your select statement. If you do so, the MobiLink synchronization server automatically inserts the user name into the first column, and then uses the rest of the columns as usual. This mechanism is available because some database-management systems provide no convenient mechanism to store the identity of the current user.

You can use this feature to conveniently identify which user inserted each row. This information allows you to include user-specific logic in the resolve_conflict script.

For example, an ordinary upload_old_row_insert script is of the following form. The items in the select list correspond to the columns of the remote table.

INSERT c1, c2, . . . , cN FROM table

However, the following syntax is also permitted.

INSERT user_name, c1, c2, . . . , cN FROM table

Normally, the selected columns must match the columns of the remote table in both number and type. This case is an exception. The single extra column in the select list must be of a type suitable to hold the user name, for example, VARCHAR(128). The subsequent columns in the list must match the columns of the remote table in order and type, as usual. If you include more than one extra column, an error results.

For more information, see upload_old_row_insert table eventand upload_new_row_insert table event.


Contents Index Forced conflict resolution Data entry