DBD-XBase
view release on metacpan or search on metacpan
driver_characteristics view on Meta::CPAN
older dBase's only allowed 255 characters, so created dbf might not be
portable to other xbase compatible software).
Are any types blank padded? If so which, e.g., CHAR.
Both CHAR and VARCHAR are blank padded (unless ChopBlanks set).
How does the database handle data with the 8th bit set (national
language character sets etc)?
Data with the 8th bit set are handles transparently, no national
language character set conversions are done.
Is Unicode supported?
Since the string types can store binary data, Unicode strings can be
stored.
=head2 Date Data Handling
lib/XBase.pm view on Meta::CPAN
date fields are returned as 8 character string of the 'YYYYMMDD' form
and when inserting the date, you again have to provide it in this
form. No checking for the validity of the date is done. The datetime
field is returned in the number of (possibly negative) seconds since
1970/1/1, possibly with decimal part (since it allows precision up to
1/1000 s). To get the fields, use the gmtime (or similar) Perl function.
If there is a memo field in the dbf file, the module tries to open
file with the same name but extension dbt, fpt or smt. It uses module
XBase::Memo(3) for this. It reads and writes this memo field
transparently (you do not know about it) and returns the data as
single scalar.
=head1 INDEX, LOCKS
B<New:> A support for ndx, ntx, mdx, idx and cdx index formats is
available with alpha status for testing. Some of the formats are
already rather stable (ndx). Please read the XBase::Index(3) man page
and the eg/use_index file in the distribution for examples and ideas.
Send me examples of your data files and suggestions for interface if
you need indexes.
lib/XBase/FAQ.pod view on Meta::CPAN
So what you really want to do is to use some external utility to
convert the strings to encoding you need -- for example, when I bring
the dbf from Win*, it often is in the Windows-1250 or PC-Latin-2
encoding, while the standard is ISO-8859-2. I use my utility
B<Cz::Cstocs> to do the conversion, you maight also try GNU program
B<recode> or use B<Text::Iconv> Perl module.
=item How do I access the fields in the memo file?
Just read the memo field, it will fetch the data from the memo file
for you transparently.
=item Matching with C<field = '%str%'> doesn't work.
If you want to match wildcards with B<DBD::XBase>, you have to use C<like>:
select * from table where field like '%str%'
=item Can I sue you if B<XBase.pm/DBD::XBase> corrupts my data?
No. At least, I hope no. The software is provided without any
"id", "msg");
$cur->find_eq(156) or do {
print "Value 156 not found.\n"; exit;
};
my ($id, $msg) = $cur->fetch;
=head1 DESCRIPTION
This module can read and write XBase database files, known as dbf in
dBase and FoxPro world. It also transparently reads memo fields from
the dbt, fpt and smt files and works with index files (ndx, ntx, mdx, idx,
cdx and SDBM). This module XBase.pm provides simple native interface
to XBase files. For DBI compliant database access, see DBD::XBase and
DBI modules and their man pages.
To work with dbf and associated files, you first need to open the
dbf file using
my $table = new XBase 'dbase.dbf' or die XBase->errstr;
=back
=head1 General methods
The general methods working with the whole files or tables.
=head2 new
Opens the existing dbf file and provides an object to interact with
the table. Memo and index files are also opened transparently. If opening
of the dbf file or any other needed file (memo, index) fails, C<new>
returns undef and the error message may be retrieved via
B<XBase-E<gt>errstr>.
The parameters to B<new> are passed as hash:
=over 4
=item name
date fields are returned as 8 character string of the 'YYYYMMDD' form
and when inserting the date, you again have to provide it in this
form. No checking for the validity of the date is done. The datetime
field is returned in the number of seconds since 1970/1/1, possibly
with decimal part (since it allows precision up to 1/1000 s). To get
the fields, use the gmtime (or similar) Perl function.
If there is a memo field in the dbf file, the module tries to open
file with the same name but extension dbt, fpt or smt. It uses module
XBase::Memo(3) for this. It reads and writes this memo field
transparently (you do not know about it) and returns the data as
normal scalar.
=head1 INFORMATION SOURCE
This module is built using information from and article XBase File
Format Description by Erik Bachmann, URL
http://www.clicketyclick.dk/databases/xbase/format/
Thanks a lot.
( run in 0.774 second using v1.01-cache-2.11-cpan-0a6323c29d9 )