Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
使用此过程在删除远程数据库后清理 MobiLink 系统表。
ml_delete_sync_state_before ( 'ts' )
ts
TIMESTAMP。日期时间的显示顺序必须与统一数据库中指定的顺序完全一致。如果统一数据库中的日期时间格式设置为 'yyyy/mm/dd hh:mm:ss.ssss',则时间戳必须以年、月、日、小时、分钟、秒、分秒的顺序显示。
此存储过程从 MobiLink 系统表中删除与不再使用的远程数据库有关的行。具体地讲,它执行以下操作:
从 ml_subscription 系统表中删除所有 last_upload_time 和 last_download_time 都早于给定时间戳的行。
如果 ml_subscription 表中的任何行都不再引用远程 ID,则从 ml_database 系统表中删除这些远程 ID。
不应将此系统过程用于过近的时间段,因为它删除的行所属的远程数据库可能实际上尚未被删除。否则,删除 ml_subscription 和 ml_database 中的行可能会导致因上载不成功而处于 "未知状态" 的远程数据库出现问题;处于该未知状态时,远程数据库依赖 MobiLink 系统表重新发送数据。
为此过程提供的时间戳必须具有正确的日期时间格式,因为该过程不会对参数的日期时间格式进行校验。
以下示例清理自 2004 年 1 月 10 日以来未曾同步的远程数据库的相关 MobiLink 系统表信息。它对日期时间格式为 yyyy/mm/dd hh:mm:ss.ssss 的 SQL Anywhere 统一数据库有效。
CALL ml_delete_sync_state_before( '2004/01/10 00:00:00' )