Because you use the file => $filename approach, you do not use the case-insensitiveness from SQL::Statement.
I do not think you should define csv_eol
When on Windows *and* other OS's, do not use $dir."/".$file, but use File::Spec.
When in doubt about casing, use something like
chdir $f_path;
foreach my $file_name (glob "*.*") {
lc $file_name eq lc $csvfile or next;
$csv_file = $file_name;
last;
}
my $dbh = DBI->connect ("dbi:CSV:", undef, undef, {
f_dir => $f_path,
f_ext => ".csv/r",
f_encoding => "utf-8",
f_schema => undef,
RaiseError => 1,
PrintError => 1,
});
$cellh->{csv_tables}{cells} = { file => $csv_file };
my $sth = $sbh->prepare ("select * from cells");
$sth->execute;
print "fields: @{[@{$sth->{NAME_lc}}]}\n";
untested, but should work.
Enjoy, Have FUN! H.Merijn
|