tags:

views:

96

answers:

3

Is there a function in MySQL that we can use in a client application that will automatically sends alerts every time a new row is inserted in a table?

+5  A: 

You will have to use/write a trigger, that will record the change in a specifically designed, just for this purpose, table, and a crone/what ever is used in MS environment to check this table every X seconds (you decide the X).
Or, write an extension to mysql...(Or pay one of the mysql developers to do it for you).

Itay Moav
why not poll the table that is being inserted into?
ninesided
Because doing things like this is the entire point of a trigger; usually, you want to use the tool designed specifically for the job.
kquinn
A: 

The simplest but (arguably) the least elegant solution is to have your client simply poll the table for changes.

ninesided
A: 

In some database (Interbase, Firebird, perhaps others...), your can trigger event. http://www.firebirdsql.org/doc/whitepapers/events_paper.pdf

I ask one day in MySQL forums about this : http://forums.mysql.com/read.php?84,3629,3629

Hugues Van Landeghem