Subject Re: [firebird-support] Re: update problem
Author Florian Hector
> sounds like a good starting point
> i've just discovered the tibevents component in delphi
> but how do i create and trigger such custom events in my database; any
> good resource on that?

Have you discovered IBExpert yet? They also offer a freeware version which has some functions
disabled but is still more than usefull for maintaining a firebird database. With this piece of
software you don't have to write each line of code yourself. You tell it for example that you want a
new trigger and it gives you a skeleton of code where you only have to insert your tablename and
your functionality.

To give you a starting point, here is a simple trigger that posts an event:

CREATE TRIGGER BESTELLAENDERUNG FOR TABBESTELL
ACTIVE AFTER DELETE or INSERT POSITION 0
AS
Begin
Post_Event 'Aenderung_Bestellung';
End

As you can see, one can define a trigger for more than one operation, in my example the event gets
fired on delete and insert operations.

In order to be able to react on an event, each client has to express interest in that particular
event, that's what you need the IB_Event alerter for. I am working with IBObjects, so I cannot tell
you anything about the IBX components.
The need for prior knowledge of the existence of an event prevents you from using the event itself
to tell the client which record has changed. In other words, you can only tell the client that
something has changed but not exactly which record.

If you have more questions, come back and ask

Florian