Was this helpful?
Event Handling Statements
The following table provides brief descriptions of the 4GL statements to enable the event handling sequence, and describes where to place the code for each statement.
See the SQL Reference Guide for detailed syntax and descriptions of the major statements involved in handling database events.
Statement
Purpose
Location
create dbevent event_name
Creates the named event in the DBMS Server.
In a separate "set-up" application, or in the Terminal Monitor with the SQL version of the statement.
(The create dbevent statement must appear outside of the application that raises the event, because you create an event only once.)
drop dbevent event_name
Lets the event owner destroy the event.
Same location as above.
raise dbevent event_name [event_text]
Notifies the DBMS Server to send a message that the named event has been raised; this message is placed in an event queue for each application that is registered to receive events.
Within the sending application, immediately after the code that describes the event (and before any transaction-handling statements, such as a commit).
register dbevent event_name
Notifies the DBMS server that an application is eligible to retrieve the named event.
Within the receiving application, before the code (get dbevent or on dbevent activation block) that receives the event.
The register dbevent statement is valid for the duration of the session, or until you issue a remove dbevent statement for the event.
remove dbevent event_name
Removes an application's registration for the named event.
Within the receiving application, when you no longer want the application to be able to receive the event.
get dbevent
[with nowait |
wait = wait_interval]
Checks an application's event queue; if it finds any events, it retrieves from the queue the next event for which the application is registered.
Within the receiving application.
You must issue a get dbevent statement (or use an on dbevent activation, described below) before you can retrieve specific information about an event.
on dbevent activation_block
Performs an implicit get dbevent statement when a user activation is executed; lets you specify statements to be executed if an event is found.
Within any frame or display submenu that might be in control when an event is raised.
(You cannot have an event activation without some other activation in the same frame or display submenu.)
inquire_sql event_info
Retrieves specific information about an event that has been received with
a get dbevent statement or on dbevent activation.
Within the receiving application, following a get dbevent statement or within an on dbevent activation block.
You must issue an inquire_sql statement before the next get dbevent or on dbevent activation, because the information about the last event is overwritten by the next event the application receives.
Last modified date: 01/30/2023