DBD::CSV::st execute failed:
Execution ERROR: No such column 'PRINT."set"'.
[for Statement "
SELECT id,
gid,
card,
"set",
illus,
num
FROM Print
"] at problem.pl line 41.
####
>perl -le"use SQL::Statement; print SQL::Statement->VERSION"
1.15
>perl -le"use DBD::CSV; print DBD::CSV->VERSION"
0.22
##
##
use strict;
use warnings;
use DBI qw( );
use File::Spec::Functions qw( catfile );
{
my $db = '.';
my $dsn = "dbi:CSV:f_dir=$db";
my $user = undef;
my $passwd = undef;
my $dbh = DBI->connect(
$dsn, $user, $passwd,
{
RaiseError => 1,
PrintError => 0,
PrintWarn => 1,
AutoCommit => 1, # No writing, so no need for transactions.
FetchHashKeyName => 'NAME_lc',
}
);
for (qw( Print )) {
my $path = catfile($db, "$_.csv");
# Xyz and "Xyz" are erroneously considered different tables.
$dbh->{csv_tables}{ $_ }{file} = $path;
$dbh->{csv_tables}{qq{"$_"}}{file} = $path;
}
my $sth = $dbh->prepare('
SELECT id,
gid,
card,
"set",
illus,
num
FROM Print
');
$sth->execute();
# ...
}
##
##
id,gid,card,set,illus,num
1,1,1,1,"Foo Bar",1