📄 dbi::faq.3
字号:
.IP "Oraperl" 4.IX Item "Oraperl"Users of the Oraperl emulation layer bundled with \fIDBD::Oracle\fR, may readup on how to program with the Oraperl interface by typing:.Sp.Vb 1\& perldoc Oraperl.Ve.SpThis will produce an updated copy of the original oraperl man page written byKevin Stock for perl4. The oraperl \s-1API\s0 is fully listed and described there..IP "Drivers" 4.IX Item "Drivers"Users of the \s-1DBD\s0 modules may read about some of the private functionsand quirks of that driver by typing:.Sp.Vb 1\& perldoc <driver>.Ve.SpFor example, the \fIDBD::mSQL\fR driver is bundled with driver-specific documentation that can be accessed by typing.Sp.Vb 1\& perldoc DBD::mSQL.Ve.IP "Frequently Asked Questions" 4.IX Item "Frequently Asked Questions"This document, the \fIFrequently Asked Questions\fR is also available as \s-1POD\s0documentation! You can read this on your own system by typing:.Sp.Vb 1\& perldoc DBI::FAQ.Ve.SpThis may be more convenient to persons not permanently, or conveniently,connected to the Internet. The \fI\s-1DBI::FAQ\s0\fR module should be downloaded andinstalled for the more up-to-date version..SpThe version of \fI\s-1DBI::FAQ\s0\fR shipped with the \f(CW\*(C`DBI\*(C'\fR module may be slightly outof date..IP "\s-1POD\s0 in general" 4.IX Item "POD in general"Information on writing \s-1POD\s0, and on the philosophy of \s-1POD\s0 in general, can beread by typing:.Sp.Vb 1\& perldoc perlpod.Ve.SpUsers with the Tk module installed may be interested to learn there is aTk-based \s-1POD\s0 reader available called \f(CW\*(C`tkpod\*(C'\fR, which formats \s-1POD\s0 in a convenientand readable way. This is available \fIvia\fR \s-1CPAN\s0 as the module called \&\fITk::POD\fR and is highly recommended..RE.RS 4.RE.IP "\fIDriver and Database Characteristics\fR" 4.IX Item "Driver and Database Characteristics"The driver summaries that were produced for Appendix B of \*(L"Programming thePerl \s-1DBI\s0\*(R" are available online at:.Sp.Vb 2\& http://dbi.perl.org/\& http://www.symbolstone.org/technology/perl/DBI.Ve.Spin the driver information table. These summaries contain standardisedinformation on each driver and database which should aid you in selectinga database to use. It will also inform you quickly of any issues withindrivers or whether a driver is not fully compliant with the \s-1DBI\s0 Specification..IP "\fIRambles, Tidbits and Observations\fR" 4.IX Item "Rambles, Tidbits and Observations".Vb 2\& http://dbi.perl.org/tidbits\& http://www.symbolstone.org/technology/perl/DBI/tidbits.Ve.SpThere are a series of occasional rambles from various people on the\&\s-1DBI\s0 mailing lists who, in an attempt to clear up a simple point, end updrafting fairly comprehensive documents. These are quite often varying inquality, but do provide some insights into the workings of the interfaces..IP "\fIArticles\fR" 4.IX Item "Articles"A list of articles discussing the \s-1DBI\s0 can be found on the \s-1DBI\s0 \s-1WWW\s0 page at:.Sp.Vb 2\& http://dbi.perl.org/\& http://www.symbolstone.org/technology/perl/DBI.Ve.SpThese articles are of varying quality and age, from the original Perl Journalarticle written by Alligator and Tim, to more recent debacles published onlinefrom about.com..IP "\fI\s-1README\s0 files\fR" 4.IX Item "README files"The \fI\s-1README\s0\fR files included with each driver occasionally contains some useful information ( no, really! ) that may be pertinent to the user.Please read them. It makes our worthless existences more bearable. Thesecan all be read from the main \s-1DBI\s0 \s-1WWW\s0 page at:.Sp.Vb 2\& http://dbi.perl.org/\& http://www.symbolstone.org/technology/perl/DBI.Ve.IP "\fIMailing Lists\fR" 4.IX Item "Mailing Lists"There are three mailing lists for \s-1DBI:\s0.Sp.Vb 3\& dbi\-announce@perl.org \-\- for announcements, very low traffic\& dbi\-users@perl.org \-\- general user support\& dbi\-dev@perl.org \-\- for driver developers (no user support).Ve.SpFor information on how to subscribe, set digest mode etc, and unsubscribe,send an email message (the content will be ignored) to:.Sp.Vb 3\& dbi\-announce\-help@perl.org\& dbi\-users\-help@perl.org\& dbi\-dev\-help@perl.org.Ve.IP "\fIMailing List Archives\fR" 4.IX Item "Mailing List Archives".RS 4.PD 0.IP "\fI\s-1US\s0 Mailing List Archives\fR" 4.IX Item "US Mailing List Archives".PD.Vb 1\& http://outside.organic.com/mail\-archives/dbi\-users/.Ve.SpSearchable hypermail archives of the three mailing lists, and some of themuch older traffic have been set up for users to browse..IP "\fIEuropean Mailing List Archives\fR" 4.IX Item "European Mailing List Archives".Vb 1\& http://www.rosat.mpe\-garching.mpg.de/mailing\-lists/PerlDB\-Interest.Ve.SpAs per the \s-1US\s0 archive above..RE.RS 4.RE.SH "Compilation Problems".IX Header "Compilation Problems".ie n .Sh "2.1. Compilation problems or ""It fails the test!""".el .Sh "2.1. Compilation problems or ``It fails the test!''".IX Subsection "2.1. Compilation problems or It fails the test!"First off, consult the \s-1README\s0 for that driver in case there is useful information about the problem. It may be a known problem for your given architecture and operating system or database. You can check the \s-1README\s0files for each driver in advance online at:.PP.Vb 2\& http://dbi.perl.org/\& http://www.symbolstone.org/technology/perl/DBI.Ve.PPIf it's a known problem, you'll probably have to wait till it gets fixed. If you're \fIreally\fR needing it fixed, try the following:.IP "\fIAttempt to fix it yourself\fR" 4.IX Item "Attempt to fix it yourself"This technique is generally \fInot\fR recommended to the faint-hearted.If you do think you have managed to fix it, then, send a patch file( context diff ) to the author with an explanation of:.RS 4.IP "\(bu" 4What the problem was, and test cases, if possible..IP "\(bu" 4What you needed to do to fix it. Please make sure you mention everything..IP "\(bu" 4Platform information, database version, perl version, module version and \&\s-1DBI\s0 version..RE.RS 4.RE.IP "\fIEmail the author\fR Do \fI\s-1NOT\s0\fR whinge!" 4.IX Item "Email the author Do NOT whinge!"Please email the address listed in the \s-1WWW\s0 pages for whichever driver youare having problems with. Do \fInot\fR directly email the author at aknown address unless it corresponds with the one listed..SpWe tend to have real jobs to do, and we do read the mailing lists forproblems. Besides, we may not have access to <\fIinsert yourfavourite brain-damaged platform here\fR> and couldn't be of anyassistance anyway! Apologies for sounding harsh, but that's the way of it!.SpHowever, you might catch one of these creative genii at 3am when we'redoing this sort of stuff anyway, and get a patch within 5 minutes. Theatmosphere in the \s-1DBI\s0 circle is that we \fIdo\fR appreciate the users'problems, since we work in similar environments..SpIf you are planning to email the author, please furnish as much informationas possible, \fIie\fR:.RS 4.IP "\(bu" 4\&\fI\s-1ALL\s0\fR the information asked for in the \s-1README\s0 file inthe problematic module. And we mean \fI\s-1ALL\s0\fR of it. We don'tput lines like that in documentation for the good of our health, orto meet obscure \s-1README\s0 file standards of length..IP "\(bu" 4If you have a core dump, try the \fIDevel::CoreStack\fR module forgenerating a stack trace from the core dump. Send us that too.\&\fIDevel::CoreStack\fR can be found on \s-1CPAN\s0 at:.Sp.Vb 1\& http://www.perl.com/cgi\-bin/cpan_mod?module=Devel::CoreStack.Ve.IP "\(bu" 4Module versions, perl version, test cases, operating system versionsand \fIany other pertinent information\fR..RE.RS 4.SpRemember, the more information you send us, the quicker we can track problems down. If you send us no useful information, expect nothing back..SpFinally, please be aware that some authors, including Tim Bunce, specificallyrequest that you do \fInot\fR mail them directly. Please respect their wishes anduse the email addresses listed in the appropriate module \f(CW\*(C`README\*(C'\fR file..RE.IP "\fIEmail the dbi-users Mailing List\fR" 4.IX Item "Email the dbi-users Mailing List"It's usually a fairly intelligent idea to \fIcc\fR the mailing listanyway with problems. The authors all read the lists, so you lose nothingby mailing there..SH "Platform and Driver Issues".IX Header "Platform and Driver Issues".Sh "3.1 What's the difference between \s-1ODBC\s0 and \s-1DBI\s0?".IX Subsection "3.1 What's the difference between ODBC and DBI?"In terms of architecture \- not much: Both define programminginterfaces. Both allow multiple drivers to be loaded to do theactual work..PPIn terms of ease of use \- much: The \s-1DBI\s0 is a 'high level' interfacethat, like Perl itself, strives to make the simple things easy whilestill making the hard things possible. The \s-1ODBC\s0 is a 'low level'interface. All nuts-bolts-knobs-and-dials..PPNow there's an \s-1ODBC\s0 driver for the \s-1DBI\s0 (\s-1DBD::ODBC\s0) the \*(L"What's thedifference\*(R" question is more usefully rephrased as:.PPChapter 7 of \*(L"Programming the Perl \s-1DBI\s0\*(R" covers this topic in far moredetail and should be consulted..Sh "3.2 What's the difference between Win32::ODBC and \s-1DBD::ODBC\s0?".IX Subsection "3.2 What's the difference between Win32::ODBC and DBD::ODBC?"The \s-1DBI\s0, and thus \s-1DBD::ODBC\s0, has a different philosophy from theWin32::ODBC module:.PPThe Win32::ODBC module is a 'thin' layer over the low-level \s-1ODBC\s0 \s-1API\s0.The \s-1DBI\s0 defines a simpler 'higher level' interface..PPThe Win32::ODBC module gives you access to more of the \s-1ODBC\s0 \s-1API\s0.The \s-1DBI\s0 and \s-1DBD::ODBC\s0 give you access to only the essentials.(But, unlike Win32::ODBC, the \s-1DBI\s0 and \s-1DBD::ODBC\s0 do support parameterbinding and multiple prepared statements which reduces the load onthe database server and can dramatically increase performance.).PPThe Win32::ODBC module only works on Win32 systems.The \s-1DBI\s0 and \s-1DBD::ODBC\s0 are very portable and work on Win32 and Unix..PPThe \s-1DBI\s0 and \s-1DBD::ODBC\s0 modules are supplied as a standard part of thePerl 5.004 binary distribution for Win32 (they don't work with theolder, non-standard, ActiveState port)..PPScripts written with the \s-1DBI\s0 and \s-1DBD::ODBC\s0 are faster than Win32::ODBCon Win32 and are trivially portable to other supported database types..PPThe \s-1DBI\s0 offers optional automatic printing or \fIdie()\fRing on errors whichmakes applications simpler and more robust..PPThe current \s-1DBD::ODBC\s0 driver version 0.16 is new and not yet fully stable.A new release is due soon [relative to the date of the next \s-1TPJ\s0 issue :\-]and will be much improved and offer more \s-1ODBC\s0 functionality..PPTo summarise: The Win32::ODBC module is your best choice if you needaccess to more of the \s-1ODBC\s0 \s-1API\s0 than the \s-1DBI\s0 gives you. Otherwise, the\&\s-1DBI\s0 and \s-1DBD::ODBC\s0 combination may be your best bet..PPChapter 7 of \*(L"Programming the Perl \s-1DBI\s0\*(R" covers this topic in far moredetail and should be consulted..Sh "3.3 Is \s-1DBI\s0 supported under Windows 95 / \s-1NT\s0 platforms?".IX Subsection "3.3 Is DBI supported under Windows 95 / NT platforms?"Finally, yes! Jeff Urlwin has been working diligently on building\&\fI\s-1DBI\s0\fR and \fI\s-1DBD::ODBC\s0\fR under these platforms, and, with theadvent of a stabler perl and a port of \fIMakeMaker\fR, the project hascome on by great leaps and bounds..PPThe \fI\s-1DBI\s0\fR and \fIDBD::Oracle\fR Win32 ports are now a standard part of \s-1DBI\s0,so, downloading \fI\s-1DBI\s0\fR of version higher than \fI0.81\fR should work fine as should using the most recent \fIDBD::Oracle\fR version..Sh "3.4 Can I access Microsoft Access or SQL-Server databases with \s-1DBI\s0?".IX Subsection "3.4 Can I access Microsoft Access or SQL-Server databases with DBI?"Yes, use the \fI\s-1DBD::ODBC\s0\fR driver..Sh "3.5 Is the a \s-1DBD\s0 for <\fIinsert favourite database here\fP>?".IX Subsection "3.5 Is the a DBD for <insert favourite database here>?"Is is listed on the \s-1DBI\s0 drivers page?.PP.Vb 2\& http://dbi.perl.org/\& http://www.symbolstone.org/technology/perl/DBI.Ve.PPIf not, no. A complete absence of a given database driver from thatpage means that no-one has announced any intention to work on it, not thatsuch a driver is impossible to write..PPA corollary of the above statement implies that if you see an announcementfor a driver \fInot\fR on the above page, there's a good chance it's notactually a \fI\s-1DBI\s0\fR driver, and may not conform to the specifications. Therefore,questions concerning problems with that code should \fInot\fR really be addressedto the \s-1DBI\s0 Mailing Lists..Sh "3.6 What's \s-1DBM\s0? And why should I use \s-1DBI\s0 instead?".IX Subsection "3.6 What's DBM? And why should I use DBI instead?"Extracted from ``\fI\s-1DBI\s0 \- The Database Interface for Perl 5\fR'':.PP.Vb 3\& \`\`UNIX was originally blessed with simple file\-based \`\`databases\*(Aq\*(Aq, namely\& the dbm system. dbm lets you store data in files, and retrieve\& that data quickly. However, it also has serious drawbacks.\&\& File Locking\&\& The dbm systems did not allow particularly robust file locking\& capabilities, nor any capability for correcting problems arising through\& simultaneous writes [ to the database ].\&\& Arbitrary Data Structures\&\& The dbm systems only allows a single fixed data structure:\& key\-value pairs. That value could be a complex object, such as a\& [ C ] struct, but the key had to be unique. This was a large\& limitation on the usefulness of dbm systems.\&\& However, dbm systems still provide a useful function for users with\& simple datasets and limited resources, since they are fast, robust and \& extremely well\-tested. Perl modules to access dbm systems have now\& been integrated into the core Perl distribution via the\& AnyDBM_File module.\*(Aq\*(Aq.Ve.PPTo sum up, \s-1DBM\s0 is a perfectly satisfactory solution for essentially read-onlydatabases, or small and simple datasets. However, for more scaleable dataset handling, not to mention robust transactional locking, users are recommended to use a more powerful database engine \fIvia\fR \fI\s-1DBI\s0\fR..PPChapter 2 of \*(L"Programming the Perl \s-1DBI\s0\*(R" discusses \s-1DBM\s0 files in detail..Sh "3.7 What database do you recommend me using?".IX Subsection "3.7 What database do you recommend me using?"This is a particularly thorny area in which an objective answer is difficultto come by, since each dataset, proposed usage and system configurationdiffers from person to person..PPFrom the current author's point of view, if the dataset is relativelysmall, being tables of less than 1 million rows, and less than 1000 tablesin a given database, then \fImSQL\fR is a perfectly acceptable solutionto your problem. This database is extremely cheap, is wonderfully robustand has excellent support. More information is available on the HughesTechnology \s-1WWW\s0 site at:.PP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -