Signaling Event Occurrences

From InterBase

Go Up to Working with Events


A trigger or stored procedure must signal the occurrence of an event, usually a database change such as an INSERT, UPDATE, or DELETE, by using the POST_EVENT statement. POST_EVENT alerts the event manager to the occurrence of an event after a transaction is committed. At that time, the event manager passes the information to registered applications.

A trigger or stored procedure that posts an event is sometimes called an event alerter. For example, the following isql script creates a trigger that posts an event to the event manager whenever any application inserts data in a table:

CREATE TRIGGER POST_NEW_ORDER FOR SALES
ACTIVE
AFTER INSERT
POSITION 0
AS
BEGIN
POST_EVENT 'new_order';
END ;

Event names have no character size restrictions.

Note:
POST_EVENT is a stored procedure and trigger language extension, available only within stored procedures and triggers.

For a complete discussion of writing a trigger or stored procedure as an event alerter, see the Data Definition Guide.

Advance To: