Re: $sth->rows problem

2003-09-08 Thread Keith C. Ivey
On 8 Sep 2003 at 14:15, Jack Coxen wrote: > sub run_query { > # print "Query: ", $statement, "\n"; > my $sth = $dbh->do($statement) > or die "Can't prepare $statement: $dbh->errstr\n"; > $numrows = ($sth->rows); # This is where the problem is > print $numrows; > } This is a DBI questio

$sth->rows problem

2003-09-08 Thread Jack Coxen
I've cobbled together a short PERL script to delete older records from the tables in a database. The DELETE works fine but when I try to put in a statement to return the number of rows deleted, I get an error. The code reads as follows: sub run_query { # print "Query: ", $statement, "\n"; my