.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "XBase::FAQ 3pm" .TH XBase::FAQ 3pm "2017-01-21" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" XBase::FAQ \- Frequently asked questions about the XBase.pm/DBD::XBase modules .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a list of questions people asked since the module has been announced in fall 1997, and my answers to them. .SH "AUTHOR" .IX Header "AUTHOR" Jan Pazdziora .SH "Questions and answers" .IX Header "Questions and answers" .IP "What Perl version do I need? What other modules?" 2 .IX Item "What Perl version do I need? What other modules?" You need perl 5.10 or newer. You need \fB\s-1DBI\s0\fR module version 1.00 or higher, if you want to use the \s-1DBD\s0 driver (which you should). .IP "Can I use \fBXBase.pm\fR under Windows 95/NT?" 2 .IX Item "Can I use XBase.pm under Windows 95/NT?" Yes. It's a standard Perl module so there is no reason it shouldn't. Or, actually, there are a lot of reasons why standard thing do not work on systems that are broken, but I'm trying hard to workaround these bugs. If you find a problem on these platform, send me a description and I'll try to find yet another workaround. .IP "Is there a choice of the format of the date?" 2 .IX Item "Is there a choice of the format of the date?" The only possible format in which you can get the date and that the module expect for inserts and updates is a 8 char string '\s-1YYYYMMDD\s0'. It is not possible to change this format. I prefer to do the formatting myself since you have more control over it. .ie n .IP "The ""get_record"" also returns deleted records. Why?" 2 .el .IP "The \f(CWget_record\fR also returns deleted records. Why?" 2 .IX Item "The get_record also returns deleted records. Why?" Because. You get the _DELETED flag as the first value of the array. This gives you a possibility to decide what to do \*(-- undelete, ignore... It's a feature \*(-- you say you want a record of given number, you get it and get additional information, if the record is or isn't marked deleted. .IP "But with \fBDBD::XBase\fR, I do not see the deleted records." 2 .IX Item "But with DBD::XBase, I do not see the deleted records." That's correct: \fBDBD::XBase\fR only gives you records that are positively in the file and not deleted. Which shows that \fBXBase.pm\fR is a lower level tool because you can touch records that are marked deleted, while \&\fBDBD::XBase\fR is higher level \*(-- it gives you \s-1SQL\s0 interface and lets you work with the file more naturaly (what is deleted should stay deleted). .IP "\fBXBase.pm\fR cannot read files created with [your favorite tool]." 2 .IX Item "XBase.pm cannot read files created with [your favorite tool]." Describe exactly, what you expect and what you get. Send me the file (I understand attachments, uuencode, tar, gzip and zip) so that I can check what it going on and make \fBXBase.pm\fR understand your file. A small sample (three rows, or so) are generally enough but you can send the whole file if it doesn't have megabytes. Please understand .IP "How to install the module when I do not have \fBmake\fR?" 2 .IX Item "How to install the module when I do not have make?" On Win* platform and with ActiveState port, use ppm to install \&\fBDBD::XBase\fR from ActiveState's site. You can also just copy the files from the lib directory of the distribution to where perl can find them. Also check whether your make doesn't hide under different names (nmake, gmake). See \f(CW\*(C`README\*(C'\fR. .IP "I have make but I cannot install into default directory." 2 .IX Item "I have make but I cannot install into default directory." Ask your sysadmin to do it for your. If he refuses, fire the sysadmin. See \f(CW\*(C`README\*(C'\fR for how to install into and use nonstandard place for the module. .IP "Can I access one dbf file both from Perl and (say) Clipper?" 2 .IX Item "Can I access one dbf file both from Perl and (say) Clipper?" For reading \*(-- yes. For writing \*(-- \fBXBase.pm\fR has a locksh and lockex method to lock the file. The question is to what extend Clipper (or Fox* or whatever) uses the same system calls, documentation of native XBase applications doesn't tell this. So the answer is that for multiple updates you should probably consider real \s-1RDBMS\s0 system (PostgreSQL, MySQL, Oracle, to name a few). .IP "\fBXBase.pm/DBD::XBase\fR breaks my accented characters." 2 .IX Item "XBase.pm/DBD::XBase breaks my accented characters." No, it doesn't. The character data is returned exactly as it appears in the dbf/dbt file. You probably brought the file from different system that uses differend character encodings. So some bytes in the strings have different meaning on that system. You also probably have fonts in different encoding on that system. In the Czech language, we have about 6 different encoding that affect possition at which accented characters appear. .Sp 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 \s-1ISO\-8859\-2. I\s0 use my utility \&\fBCz::Cstocs\fR to do the conversion, you maight also try \s-1GNU\s0 program \&\fBrecode\fR or use \fBText::Iconv\fR Perl module. .IP "How do I access the fields in the memo file?" 2 .IX 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. .ie n .IP "Matching with ""field = \*(Aq%str%\*(Aq"" doesn't work." 2 .el .IP "Matching with \f(CWfield = \*(Aq%str%\*(Aq\fR doesn't work." 2 .IX Item "Matching with field = %str% doesn't work." If you want to match wildcards with \fBDBD::XBase\fR, you have to use \f(CW\*(C`like\*(C'\fR: .Sp .Vb 1 \& select * from table where field like \*(Aq%str%\*(Aq .Ve .IP "Can I sue you if \fBXBase.pm/DBD::XBase\fR corrupts my data?" 2 .IX Item "Can I sue you if XBase.pm/DBD::XBase corrupts my data?" No. At least, I hope no. The software is provided without any warranty, in a hope you might find is useful. Which is by the way the same as with most other software, even if you pay for that. What is different with \fBXBase.pm/DBD::XBase\fR is the fact that if you find out that the results are different from those expected, you are welcome to contact me, describe the problem and send me the files that give troubles to the module, and I'll try to find fix the module. .IP "What dbf/other files standard does the module support?" 2 .IX Item "What dbf/other files standard does the module support?" I try to support any file that looks reasonably as dbf/dbt/fpt/smt/ndx/ntx/mdx/idx/cdx. There are many clones of XBase-like software, each adding its own extension. The module tries to accept all different variations. To do that, I need your cooperation however \*(-- usually good description of the problem, file sample and expected results lead to rather fast patch. .IP "What \s-1SQL\s0 standard does the \fBDBD::XBase\fR support?" 2 .IX Item "What SQL standard does the DBD::XBase support?" If supports a reasonable subset of the \s-1SQL\s0 syntax, \s-1IMHO.\s0 So you can do select, delete, insert and update, create and drop table. If there is something that should be added, let me know and I will consider it. Having said that, I do not expect to ever support joins, for example. This module is more a parser to read files from your legacy applications that a \s-1RDBMS\s0 \*(-- you can find plenty of them around \*(-- use them. .IP "I downloaded you module I do not know how to install it." 2 .IX Item "I downloaded you module I do not know how to install it." Did you follow the steps in the \f(CW\*(C`README\*(C'\fR and \f(CW\*(C`INSTALL\*(C'\fR files? Where did it fail? This module uses a standard way modules in Perl are installed. If you've never installed a module on your system and your system is so non-standard that the general instruction do not help, you should contact your system administrator or the support for your system. .ie n .IP """select max(field) from table"" does not work." 2 .el .IP "\f(CWselect max(field) from table\fR does not work." 2 .IX Item "select max(field) from table does not work." Aggregate functions are not supported. It would probably be very slow, since the \s-1DBD\s0 doesn't make use of indexes at the moment. I do not have plans to add this support in some near future. .ie n .IP """DBI\->connect"" says that the directory doesn't exist ..." 2 .el .IP "\f(CWDBI\->connect\fR says that the directory doesn't exist ..." 2 .IX Item "DBI->connect says that the directory doesn't exist ..." \&... but it's there. Is \fBDBD::XBase\fR mad or what? .Sp The third part of the first parameter to the connect is the directory where \fBDBD::XBase\fR will look for the dbf files. During connect, the module checks \f(CW\*(C`if \-d $directory\*(C'\fR. So if it says it's not there, it's not there and the only thing \fBDBD::XBase\fR can do about it is to report it to you. It might be that the directory is not mounted, you do not have permissions to it, the script is running under different \s-1UID\s0 than when you try it from command line, or you use relative patch and run the script from a different directory (pwd) than you expect. Anyway, add .Sp .Vb 1 \& die "Error reading $dir: $!\en" unless \-d $dir; .Ve .Sp to your script and you will see that it's not \fBDBD::XBase\fR problem. .IP "The \fBXBase.pm/dbf_dump\fR stops after reading \fIn\fR records ..." 2 .IX Item "The XBase.pm/dbf_dump stops after reading n records ..." \&... why doesn't it read all \fI10 x n\fR records? .Sp Check if the file isn't truncated. \f(CW\*(C`dbf_dump \-i file.dbf\*(C'\fR will tell you the expected number of records and length of one record, like .Sp .Vb 7 \& Filename: file.dbf \& Version: 0x03 (ver. 3) \& Num of records: 65 \& Header length: 1313 \& Record length: 1117 \& Last change: 1998/12/18 \& Num fields: 40 .Ve .Sp So the expected length of the file is at least \fI1313 + 65 * 1117\fR. If it's shorter, you've got damaged file and \fBXBase.pm/dbf_dump\fR only reads as much rows as it can find in the dbf. .IP "How is this \fBDBD::XBase\fR related to \fB\s-1DBD::ODBC\s0\fR?" 2 .IX Item "How is this DBD::XBase related to DBD::ODBC?" \&\fBDBD::XBase\fR reads the dbf files directly, using the (included) \&\fBXBase.pm\fR module. So it will run on any platform with reasonable new perl. With \fB\s-1DBD::ODBC\s0\fR, you need an \s-1ODBC\s0 server, or some program, that \&\fB\s-1DBD::ODBC\s0\fR could talk to. Many proprietary software can serve as \s-1ODBC\s0 source for dbf files, it just doesn't seem to run on Un*x systems. And is also much more resource intensive, if you just need to read the file record by record and convert it to \s-1HTML\s0 page or do similarly simple operation with it. .IP "How do I pack the dbf file, after the records were deleted?" 2 .IX Item "How do I pack the dbf file, after the records were deleted?" \&\fBXBase.pm\fR doesn't support this directly. You'd probably want to create new table, copy the data and rename back. Patches are always welcome. .IP "Foxpro doesn't see all fields in dbf created with \fBXBase.pm\fR." 2 .IX Item "Foxpro doesn't see all fields in dbf created with XBase.pm." Put 'version' => 3 options in to the create call \*(-- that way we say that the dbf file is dBaseIII style. .SH "AVAILABLE FROM" .IX Header "AVAILABLE FROM" http://www.adelton.com/perl/DBD\-XBase/