开发者

Advantage Notification Trigger

开发者 https://www.devze.com 2023-01-13 16:56 出处:网络
Has anyone used an Notification Trigger successfully? Does anyone k开发者_Go百科now where I can get a sample of the string returned?

Has anyone used an Notification Trigger successfully?

Does anyone k开发者_Go百科now where I can get a sample of the string returned?

Thanks,

Howard


I'm not completely sure what you are looking for, but you can create a trigger that will signal an event like this:

CREATE TRIGGER MyNotifier ON EventTest
   AFTER UPDATE 
BEGIN 
   execute procedure sp_SignalEvent( 'UpdateOccurred', 
                   false, 0, 'some data' );
END; 

Then the following two statements will create the event and then wait for it (30 seconds in this example). The data that would be returned is the last parameter in the sp_SignalEvent procedure ('some data' in the above example). More realistic would be to use data that was updated in the table.

execute procedure sp_CreateEvent( 'UpdateOccurred', 2 );
execute procedure sp_WaitForEvent( 'UpdateOccurred', 30000, 0, 0 );

The documentation for sp_CreateEvent also provides an example.

0

精彩评论

暂无评论...
验证码 换一张
取 消