hgtmp has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks.
I would like to get in contact with your wisdom.
My Problem is:
I would like to read out a DBF-file with Perl. So I decide to install DBI and DBD::XBase.
I wonder what values I get on this way in comparison to 'Simple DBF Browser'
DBI, DBD::XBase Simple DBF Browser
3.64659971882507e-317 2012
3.77611606348848e-317 2013
3.90563240815189e-317 2014
4.0351487528153e-317 2015
4.1646650974787e-317 2016
4.29418144214211e-317 2017
I 'prefer' the values (years) 'Simple DBF Browser' returns because on a third way I get the same values.
My OS is Windows XP and I use Strawberry Perl 5.16.
I search the web for the problem, but found no hint.
Hope you can help me on!
Any hint will be great.
Thanks in advance, Holger
I would like to get in contact with your wisdom.
My Problem is:
I would like to read out a DBF-file with Perl. So I decide to install DBI and DBD::XBase.
I wonder what values I get on this way in comparison to 'Simple DBF Browser'
DBI, DBD::XBase Simple DBF Browser
3.64659971882507e-317 2012
3.77611606348848e-317 2013
3.90563240815189e-317 2014
4.0351487528153e-317 2015
4.1646650974787e-317 2016
4.29418144214211e-317 2017
I 'prefer' the values (years) 'Simple DBF Browser' returns because on a third way I get the same values.
My OS is Windows XP and I use Strawberry Perl 5.16.
I search the web for the problem, but found no hint.
Hope you can help me on!
Any hint will be great.
Thanks in advance, Holger
use DBI; my $dbf_dir = 'C:/Data/MoSes_Automatisierung/ws_test_orig/output/mcev/ +EEV12Q2/EEV_batchrun_1/'; my $tbl = 'EEV_DET_BATCHRUN_1~MAIN.DBF'; my $dbh = DBI->connect("DBI:XBase:".$dbf_dir) or die $DBI::errstr; # { my $sth = $dbh->prepare("select CAL_YEAR from $tbl") or die $dbh-> +errstr(); $sth->execute() or die $sth->errstr(); while (my @DATA = $sth->fetchrow_array()) { print join(',', @DATA), "\n"; } $sth->finish(); } $dbh->disconnect();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Problem with DBI, DBD::XBase
by stefbv (Curate) on Jan 19, 2013 at 09:48 UTC | |
by hgtmp (Initiate) on Jan 21, 2013 at 08:54 UTC | |
by stefbv (Curate) on Jan 21, 2013 at 10:52 UTC | |
by hgtmp (Initiate) on Jan 22, 2013 at 08:57 UTC | |
by stefbv (Curate) on Jan 22, 2013 at 16:08 UTC | |
|
Back to
Seekers of Perl Wisdom