ml_delete_sync_state_before system procedure

Use this procedure to clean up the MobiLink system tables when you have dropped remote databases.

Syntax
ml_delete_sync_state_before ( 
'ts' 
)
Parameters

Syntax

Description

ts

TIMESTAMP. The datetime must appear in exactly the order specified in the consolidated database. If the datetime format in the consolidated database is set to 'yyyy/mm/dd hh:mm:ss.ssss', then the timestamp must appear in the order year, month, day, hour, minute, second, fraction of second.

Remarks

This stored procedure removes rows from MobiLink system tables that pertain to remote databases that are no longer being used. In particular, it does the following:

  • Deletes all the rows from the ml_subscription system table that have both the last_upload_time and last_download_time earlier than the given timestamp.
  • Removes remote IDs from the ml_database system table if the remote IDs are no longer referenced by any rows in the ml_subscription table.

You should not use this system procedure for a time period that is so recent that it may delete rows for remote databases that have not actually been deleted. If you do, the deletion of the rows in ml_subscription and ml_database could cause problems for remote databases that are in an "unknown state" caused by an unsuccessful upload; in that unknown state, the remote relies on the MobiLink system tables to resend data.

The timestamp provided to this procedure must have a correct date-time format because the procedure does not validate the date-time format of the parameter.

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

See also
Example

The following example cleans up MobiLink system table information about remote databases that have not synchronized since January 10, 2004. It works for a SQL Anywhere consolidated database where the date-time format in the consolidated database is yyyy/mm/dd hh:mm:ss.ssss.

CALL ml_delete_sync_state_before( '2004/01/10 00:00:00' )