Subject Re: [firebird-support] Subscribing Events
Author Helen Borrie
At 09:05 AM 15/09/2003 +0100, you wrote:
>Hello All,
>I can publish an event by writing POST_EVENT(<event_name>) in a stored
>procedure or in a trigger. Can someone tell me how to become a subscriber
>of this event in another stored procedure?

That's not what events are for: they are for signalling the client.

>What I want is whenever my 'publisher' stored procedure is called, all the
>'subscriber' stored procedures should also be executed.

Why can't your 'publisher' procedure call the 'subscriber' procedures
itself? Alternatively (or in combination with procedure calls) you can
cause triggers to run off any DML calls performed by your procedures.

>In the '60EmbedSql.pdf', they have given some syntax, but it is for
>embedded sql and the syntax(i.e., EVENT INIT, etc.) doesn't even lets to
>compile the stored procedure.

EVENT INIT is a client-side request which signals to the event manager that
the client is listening for the event (or a list of up to 16 events).

Embedded SQL (ESQL) is not procedure language (PSQL). It's a special
subset of SQL that can be preprocessed by the gpre program into native host
language macro calls that are functionally equivalent to the API calls made
in dynamic SQL (DSQL). An ESQL program is a client program - it is not
equivalent to a PSQL module, which executes on the server and is invoked by
an SQL request. In fact, an ESQL program can call stored procedures...