in reply to Tailing a database table via DBI
If that's a negative, and if earlier suggestions about triggers are not feasible for you, then the level of "efficiency" depends on how fast things are happening with the table, how big it is, and how closely you want to keep up...
... Because the only other solution I can see is to poll the table at some regular interval to see how big it is now, compared to how big it was the last time you polled it (i.e. "select count(*) from table"). Then, I guess you'd have to read the table and just hand the last/newest record(s) to your subroutine. (There is a "mysql_data_seek()" call in the MySql C API, but I don't know if that's accessible via DBI.) Good luck.
|
---|