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
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();
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.