It may be worth your time to read the documentation associated with DBD::CSV a little more thoroughly.
I've never used DBD::CSV as a driver, but the use of the DBI module is pretty much the same everywhere -- you create a database handle, you prepare a statement on that handle, you execute the handle and you retrieve the result set.
In your example, it looks as though you are creating a new table with the not very interesting name of 'a' and storing it in the /base directory on your file system. To use an existing CSV file, I think you want the third example in the documentation:
$dbh = DBI->connect(qq{DBI:CSV:csv_sep_char=\\;}); $dbh->{'csv_tables'}->{'info'} = { 'file' => 'info.csv'}; $sth = $dbh->prepare("SELECT * FROM info");
Also, don't forget about Super Search; there seem to be lots of nodes on this topic, including this randomly selected one: Problem parsing semicolon delimited file with DBD::CSV.
In reply to Re: dbi:csv how to
by ptum
in thread dbi:csv how to
by zli034
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |