DBD::CSV

A DBI driver for CSV files.
Download

DBD::CSV Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jeff Zucker
  • Publisher web site:
  • http://search.cpan.org/~timb/DBI-1.604/lib/DBD/DBM.pm

DBD::CSV Tags


DBD::CSV Description

A DBI driver for CSV files. DBD::CSV is a DBI driver for CSV files.SYNOPSIS use DBI; $dbh = DBI->connect("DBI:CSV:f_dir=/home/joe/csvdb") or die "Cannot connect: " . $DBI::errstr; $sth = $dbh->prepare("CREATE TABLE a (id INTEGER, name CHAR(10))") or die "Cannot prepare: " . $dbh->errstr(); $sth->execute() or die "Cannot execute: " . $sth->errstr(); $sth->finish(); $dbh->disconnect(); # Read a CSV file with ";" as the separator, as exported by # MS Excel. Note we need to escape the ";", otherwise it # would be treated as an attribute separator. $dbh = DBI->connect(qq{DBI:CSV:csv_sep_char=;}); $sth = $dbh->prepare("SELECT * FROM info"); # Same example, this time reading "info.csv" as a table: $dbh = DBI->connect(qq{DBI:CSV:csv_sep_char=;}); $dbh->{'csv_tables'}->{'info'} = { 'file' => 'info.csv'}; $sth = $dbh->prepare("SELECT * FROM info");The DBD::CSV module is yet another driver for the DBI (Database independent interface for Perl). This one is based on the SQL "engine" SQL::Statement and the abstract DBI driver DBD::File and implements access to so-called CSV files (Comma separated values). Such files are mostly used for exporting MS Access and MS Excel data.See DBI(3) for details on DBI, SQL::Statement(3) for details on SQL::Statement and DBD::File(3) for details on the base class DBD::File. Requirements: · Perl


DBD::CSV Related Software