in reply to Can't fetch using 2 placeholders in SELECT statement
use strict; use warnings; # or add the -w flag on your shebang line my $sql = "..."; my $dbh = ...; my $sth = ...; while (<>) { chomp; next unless $_; my ($sn, $ii) = split(/\s+/, $_, 2); $sth->execute($sn, $ii) or warn $DBI::errstr; if (my ($s, $i) = $sth->fetchrow_array()) { print "Serial Number: $s Item ID: $i\n"; } else { print "Select failed for ($sn) <$ii>\n"; } }
|
|---|