Subject Newbee to events - how to know which record changed
Author Maya Opperman
Hi All,

I'm starting to use events for the first time, and decided to start by
experimenting on our inhouse bug tracker.

First project - trigger an event when a task has been completed, then
detect this event and mail the appropriate people.

Thanks to the info from Helen's trusty "The Firebird Book" I have put
the following code in the Before Update trigger on my Tasks table:

if ((old."DateTested2" is null) and (New."DateTested2" is not null))
then
post_event 'task_completed';

Next I fired up my Delphi, and added the components to detect the event,
but all I have available to me is the event name, and a counter.

My question is, how do I know what record triggered the event? Is there
any way of passing additional data through to the application?

If I do a query for all tasks completed today, I'll possibly get more
than one back, and the list will get longer as the day goes on.

I presume I need to have some kind of an event logging table and insert
the relevant information in there. In which case, I don't even need
events at all anyway?? (OK, maybe just one event on my EventLog table
every time a record is inserted to save me polling it periodically)

I'm getting the feeling I might be missing the whole point of Firebird
events?

Thanks
Maya