7.6.17. POST_EVENT

Used for

Notifying listening clients about database events in a module

Available in

PSQL

Syntax

  1. POST_EVENT event_name
Table 94. POST_EVENT Statement Parameter
ArgumentDescription

event_name

Event name (message) limited to 127 bytes

The POST_EVENT statement notifies the event manager about the event, which saves it to an event table. When the transaction is committed, the event manager notifies applications that are signalling their interest in the event.

The event name can be some sort of code or a short message: the choice is open as it is just a string up to 127 bytes.

The content of the string can be a string literal, a variable or any valid SQL expression that resolves to a string.

Example

Notifying the listening applications about inserting a record into the SALES table:

  1. SET TERM ^;
  2. CREATE TRIGGER POST_NEW_ORDER FOR SALES
  3. ACTIVE AFTER INSERT POSITION 0
  4. AS
  5. BEGIN
  6. POST_EVENT 'new_order';
  7. END^
  8. SET TERM ;^