dbi_csv_filenames_with_periods

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



To: Bodo Eing <eingb@uni-muenster.de>
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: .htpasswd and DBD::CSV
Date: Fri, 13 Jul 2001 11:29:05 -0700

Bodo Eing wrote:
> 
> regarding the items you mentioned above, true. But *DBD::CSV does not work
> with files containing periods the file name*,

Not quite right, see below.

> because the file names are used
> as the table names by the SQL Layer on top of Text::CSV_XS.

Right, because a period in a table name has a specific meaning in SQL,
different than the one it does in a file system.

That's why DBD::AnyData uses a catalog statement to associate a file
name with a table name:

    $dbh->func( 'htp', 'CSV', '.htpasswd','ad_catalog')

That says to use the alias "htp" to refer to the CSV formatted table
held in the file ".htpasswd".  The period is legal in the file name but
not in the table name.

The same kind of thing is also available in DBD::CSV with the csv_tables
hash:

    $dbh->{csv_tables}->{htp}->{file} = '.htpasswd';

That accomplishes the same thing for DBD::CSV that the example above
accomplishes for DBD::AnyData.

===

the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu