in reply to Perl to monitor a table in database
while (1) { my ($ct1) = $dbh->selectrow_array('select count(*) from TABLE'); sleep 60; my ($ct2) = $dbh->selectrow_array('select count(*) from TABLE'); print ($ct2 - $ct1)," rows added in the last minute\n"; }
Update: While I fully agree that a database trigger would be far more efficient and functional than a simple rowcount query, my suggestion was based on two assumptions:
The original poster - an Initiate here - seems to have fully understood my suggestion, or rather the implications of it. I'm surprised, shocked even, at the non-Perl-based responses by people who have been here far longer.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl to monitor a table in database
by MidLifeXis (Monsignor) on Oct 26, 2009 at 15:29 UTC | |
|
Re^2: Perl to monitor a table in database
by pid (Monk) on Oct 27, 2009 at 02:28 UTC |