in reply to Re: DBD::CSV::prepare() problems
in thread DBD::CSV::prepare() problems
Dear Tux
Thanks for your reply
this is how I connect to the CSV database
use DBI; ... #MS Windows path to files my $fpath="G:\\in"; #LINUX server paths #my $fpath="/users/excel/in"; my $csvfile="Trx_24Aug2012_0409.csv"; my $cellh = DBI->connect("DBI:CSV:f_dir=$fpath;csv_eol=\n;"); #associate csv file with tablename my $fname=$fpath.'/'.$csvfile; $cellh->{'csv_tables'}->{'CELLS'} = {'file' =>$fname}; my $sql="select * from CELLS"; my $stcellh = $cellh->prepare($sql) or die "$DBI::errstr\n"; $stcellh->execute() or die "$DBI::errstr\n"; my $colunmcount = $stcellh->{NUM_OF_FIELDS}; print "$colunmcount\n\n"; $stcellh->finish();
Thanks again
Polelo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: DBD::CSV::prepare() problems
by Tux (Canon) on Aug 25, 2012 at 21:20 UTC | |
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 | |
|
Re^3: DBD::CSV::prepare() problems
by remiah (Hermit) on Aug 25, 2012 at 10:32 UTC |