Using a trigger is exactly what I have done. It works great and you get to easily control the parameters of event.

Just register your user-defined function and create a trigger thusly.

create trigger log_report after
insert on logEvent
for each row
begin
select appLogCallback ('logEvent', new.pid, new.key, new.title) from logEvent where pid = new.pid;
end;



- jason

On Apr 19, 2005, at 4:48 AM, Ulrik Petersen wrote:

Hi Frank,

F.W.A. van Leeuwen wrote:

I've asked this two weeks ago but no reply yet...

I've got one application that writes to the database, and one that reads from it. When a table in the database has changed, the reading application needs to know that. Of course I can send a signal from the writer to the reader app, but if the database would have a means for that, I think it would be more elegant (not directly coupling the writer and the reader). So it would be nice if a C application could subscribe to "table changed" events. I don't think it is currently possible with SQLite, is it?

Frank.


Isn't that what triggers are for? Perhaps you could couple a trigger with a user-defined function.


HTH

Ulrik

--
Ulrik Petersen, MA, B.Sc.
University of Aalborg, Denmark






Reply via email to