7. Understanding Database Procedures, Sessions, and Events : Database Events : Database Event Statements : Get Dbevent Statement Example
 
Share this page                  
Get Dbevent Statement Example
The following example shows a loop that processes all database events in the database event queue. The loop terminates when there are no more database events in the queue.
loop
     exec sql get dbevent;
     exec sql inquire_sql (:event_name =
          dbeventname);
     if event_name = 'event_1'
          process event 1
     else
     if event_name = 'event_2'
          process event 2
     else
          ...
     endif
until event_name = ''