Win has asked for the wisdom of the Perl Monks concerning the following question:
I want it to return the output from the SQL queries to the result file(s).foreach (@SQL_queries) { my $Get_results = $_; my $sth_atl = $dbh->prepare($Get_results) or die "Couldn't prepare + query: ".$dbh->errstr; $sth_atl->execute() or die "Couldn't execute query: ".$sth_atl->er +rstr; my $cols_for_row_B; while ($cols_for_row_B = $sth_atl->fetchrow_array) { local $" = "\t"; print OUTFILE $cols_for_row_B; print OUTFILE "\n"; } } undef @SQL_queries;
while ($cols_for_row_B = $sth_atl->fetchrow_array) { local $" = "\t"; print OUTFILE $_; print OUTFILE "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: returning rows using SQL + Perl DBI
by fisher (Priest) on Nov 22, 2010 at 10:47 UTC | |
by Win (Novice) on Nov 22, 2010 at 10:58 UTC | |
by fisher (Priest) on Nov 22, 2010 at 11:30 UTC | |
by mje (Curate) on Nov 22, 2010 at 11:28 UTC | |
|
Re: returning rows using SQL + Perl DBI
by roboticus (Chancellor) on Nov 22, 2010 at 11:41 UTC | |
|
Re: returning rows using SQL + Perl DBI
by Corion (Patriarch) on Nov 22, 2010 at 10:46 UTC |