in reply to Re^2: DBD::CSV::prepare() problems
in thread DBD::CSV::prepare() problems
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: DBD::CSV::prepare() problems
by Anonymous Monk on Aug 26, 2012 at 11:29 UTC | |
by afoken (Chancellor) on Aug 26, 2012 at 20:40 UTC | |
by Anonymous Monk on Aug 27, 2012 at 00:34 UTC |
In Section
Seekers of Perl Wisdom