Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
此轮询事件接受 SQL 脚本,并在通告程序检查统一数据库中是否有推式请求之前触发。缺省情况下,此值为空值,所以不触发此事件。
此示例为名为 Notifier A 的通告程序创建推式请求。它使用一条 SQL 语句向名为 PushRequest 的表中插入行。此表中的每一行都代表发送到一个地址的消息。WHERE 子句决定哪些推式请求被插入到 PushRequest 表中。
要将 ml_add_property 系统过程与 SQL Anywhere 统一数据库一起使用,请运行以下命令:
ml_add_property( 'SIS', 'Notifier(Notifier A)', 'begin_connection', 'INSERT INTO PushRequest (gateway, mluser, subject, content) SELECT ''MyGateway'', DISTINCT mluser, ''sync'', stream_param FROM MLUserExtra, mluser_union, Dealer WHERE MLUserExtra.mluser = mluser_union.name AND (push_sync_status = ''waiting for request'' OR datediff( hour, last_status_change, now() ) > 12 ) AND ( mluser_union.publication_name is NULL OR mluser_union.publication_name =''FullSync'' ) AND Dealer.last_modified > mluser_union.last_sync_time' );