in reply to Re^8: SQL query using elements from array
in thread SQL query using elements from array
Try this, untested:
use Data::Dumper; my $sth = $dbh->prepare($sql2); $dbh->{RaiseError} = 1; foreach my $i (0 .. @date1 - 1) { eval { $sth->execute($date1[$i], $date2[$i]); my @row; while (@row = $sth->fetchrow_array) { # retrieve one row at +a time print join(", ", @row), "\n"; } }; if ($@) { print "$@\n"; print Dumper($sth->{ParamValues}); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: SQL query using elements from array
by AllPaoTeam (Sexton) on Oct 15, 2014 at 15:46 UTC | |
by mje (Curate) on Oct 16, 2014 at 08:35 UTC | |
by AllPaoTeam (Sexton) on Oct 17, 2014 at 17:13 UTC |