Sunday, May 1, 2011

MySQL function that alerts if a new row is inserted.

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?

From stackoverflow
  • 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).

    ninesided : why not poll the table that is being inserted into?
    kquinn : Because doing things like this is the entire point of a trigger; usually, you want to use the tool designed specifically for the job.
  • The simplest but (arguably) the least elegant solution is to have your client simply poll the table for changes.

  • 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

0 comments:

Post a Comment