learningperl01 has asked for the wisdom of the Perl Monks concerning the following question:
my @lines = read_file('/tmp/test.txt'); chomp(@lines); my $sql = q|select * from table_name where srcaddr = ? or dstaddr = ?; foreach my $line (@lines) { $sth->execute($line, $line) or die "Can't execute SQL statemen +t: $DBI::errstr\n"; my @all_rows; while (($line) = $sth->fetchrow_array()) { push(@all_rows, $line); } foreach (@all_rows) { print "$_\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Saving sql results to an array all rows?
by kyle (Abbot) on Aug 18, 2008 at 15:40 UTC | |
by learningperl01 (Beadle) on Aug 18, 2008 at 18:25 UTC | |
|
Re: Saving sql results to an array all rows?
by dHarry (Abbot) on Aug 18, 2008 at 15:27 UTC | |
by learningperl01 (Beadle) on Aug 18, 2008 at 15:38 UTC | |
|
Re: Saving sql results to an array all rows?
by Krambambuli (Curate) on Aug 18, 2008 at 15:35 UTC | |
by learningperl01 (Beadle) on Aug 18, 2008 at 17:33 UTC | |
by Krambambuli (Curate) on Aug 18, 2008 at 19:27 UTC | |
by learningperl01 (Beadle) on Aug 19, 2008 at 15:26 UTC | |
by Krambambuli (Curate) on Aug 19, 2008 at 16:12 UTC | |
|