Test for existing data in a db w/ perl.

my $sth = $dbh->prepare_cached(q(select primary_key from table where primary_key = ?)) or die “Couldn’t prepare statement: ” . $dbh->errstr;
$sth->execute; my ($count) = $sth->fetchrow_array; $sth->finish
unless ($count) {

}

This entry was posted in Blog. Bookmark the permalink.

Comments are closed.