James Vahn
2005-11-26 16:25:26 UTC
The simplist things.. Anyone see my mistake? The next block of text
is a CSV file called "data.csv" and the next is a Perl script to read
read it. The last block is the error I'm getting.
partno,title,author
001555789,"PROGRAMMING PERL",WALL
40015152345,"LEARNING BASH",NEWMAN
#!/usr/bin/perl -w
use DBI;
use DBD::CSV;
$dbh = DBI->connect("DBI:CSV:f_dir=.;csv_sep_char=\\,");
$sth = $dbh->prepare("SELECT * FROM data.csv");
$sth->dump_results();
$sth->execute();
while ( @row = $sth->fetchrow_array ) { print "@row\n" }
$sth->finish();
$dbh->disconnect();
__END__
0 rows (1: Attempt to fetch row from a Non-SELECT statement)
DBD::CSV::st dump_results failed: Attempt to fetch row from a
Non-SELECT statement [for Statement "SELECT * FROM data.csv"]
at ./CSV.pl line 9.
--
is a CSV file called "data.csv" and the next is a Perl script to read
read it. The last block is the error I'm getting.
partno,title,author
001555789,"PROGRAMMING PERL",WALL
40015152345,"LEARNING BASH",NEWMAN
#!/usr/bin/perl -w
use DBI;
use DBD::CSV;
$dbh = DBI->connect("DBI:CSV:f_dir=.;csv_sep_char=\\,");
$sth = $dbh->prepare("SELECT * FROM data.csv");
$sth->dump_results();
$sth->execute();
while ( @row = $sth->fetchrow_array ) { print "@row\n" }
$sth->finish();
$dbh->disconnect();
__END__
0 rows (1: Attempt to fetch row from a Non-SELECT statement)
DBD::CSV::st dump_results failed: Attempt to fetch row from a
Non-SELECT statement [for Statement "SELECT * FROM data.csv"]
at ./CSV.pl line 9.
--