ml_delete_sync_state system procedure

Use this procedure to delete unused or unwanted synchronization states.

Syntax
ml_delete_sync_state ( 
'user', 
'remote_id' 
)
Parameters

Syntax

Description

user

VARCHAR(128). The MobiLink user name.

remote_id

VARCHAR(128). The remote ID.

Remarks

These parameters can be null. If all the parameters are null, the procedure does nothing.

This stored procedure deletes all the rows from the ml_subscription table for the given MobiLink user name and remote ID. It also removes this remote ID from the ml_database table, if the remote ID is no longer referenced by any rows in the ml_subscription table.

If the remote ID is null and the MobiLink user name is not null, it removes all the rows that are referenced by the given MobiLink user name from the ml_subscription table as well as all the remote IDs from the ml_database table, if these remote IDs are no longer referenced by any rows in the ml_subscription table.

If the MobiLink user name is null and the remote ID is not null, this stored procedure removes all the rows from the ml_subscription table as well as the ml_database table for the given remote ID.

The MobiLink user is not removed by this stored procedure, even if all the remote IDs have been deleted from the ml_database table and this user is no longer referenced by any rows in the ml_subscription table. If this MobiLink user needs to be deleted, you may delete it by issuing a command such as

delete * from ml_user where name = ‘user_name

where user_name is the MobiLink user you want to delete.

Use this stored procedure with extreme caution because the MobiLink server automatically adds this remote ID in the ml_database and ml_subscription tables without checking its synchronization status the next time the MobiLink client requests synchronization for this remote ID. It may cause data inconsistency to delete synchronization states for a remote ID that did not have a successful synchronization in the last synchronization attempt.

For DB2 mainframe consolidated database types, this procedure is called ml_del_sstate. See IBM DB2 mainframe system procedure name conversions.

See also
Example

The following example cleans up MobiLink system table information about remote databases with the remote ID remote_db_for_John for the MobiLink user John:

CALL ml_delete_sync_state( 'John', 'remote_db_for_John' )