sz has asked for the wisdom of the Perl Monks concerning the following question:
#!perl -w use DBI; use strict; my $dbh = DBI->connect("DBI:CSV:csv_sep_char=|:f_dir=Hard Disk:develop +ment") or die "Cannot connect: " . $DBI::errstr; $dbh->{'RaiseError'} = 1; $dbh->{'csv_tables'}->{'productDB'} = { 'file' => 'productDB', 'col_names'=>["product_id","product","price","name","image_url +","description","options"], }; my $sth = $dbh->prepare("SELECT * FROM productDB"); $sth->execute() or die "Cannot execute: " . $sth->errstr(); my @row; while (@row = $sth->fetchrow_array) { print ("Row: @row\n");} $sth->finish(); $dbh->disconnect;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: DBD::CSV and Macperl
by mattr (Curate) on Sep 01, 2000 at 06:53 UTC | |
by mattr (Curate) on Sep 01, 2000 at 07:31 UTC | |
|
Re: DBD::CSV and Macperl
by sz (Friar) on Sep 01, 2000 at 19:45 UTC |