One Hat Cyber Team
Your IP :
216.73.216.216
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
vo
/
perl
/
mod
/
DBI-1.13
/
blib
/
man3
/
Edit File:
DBI::FAQ.3
.rn '' }` ''' $RCSfile$$Revision$$Date$ ''' ''' $Log$ ''' .de Sh .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp .if t .sp .5v .if n .sp .. .de Ip .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .de Vb .ft CW .nf .ne \\$1 .. .de Ve .ft R .fi .. ''' ''' ''' Set up \*(-- to give an unbreakable dash; ''' string Tr holds user defined translation string. ''' Bell System Logo is used as a dummy character. ''' .tr \(*W-|\(bv\*(Tr .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" "" ''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of ''' \*(L" and \*(R", except that they are used on ".xx" lines, ''' such as .IP and .SH, which do another additional levels of ''' double-quote interpretation .ds M" """ .ds S" """ .ds N" """"" .ds T" """"" .ds L' ' .ds R' ' .ds M' ' .ds S' ' .ds N' ' .ds T' ' 'br\} .el\{\ .ds -- \(em\| .tr \*(Tr .ds L" `` .ds R" '' .ds M" `` .ds S" '' .ds N" `` .ds T" '' .ds L' ` .ds R' ' .ds M' ` .ds S' ' .ds N' ` .ds T' ' .ds PI \(*p 'br\} .\" If the F register is turned on, we'll generate .\" index entries out stderr for the following things: .\" TH Title .\" SH Header .\" Sh Subsection .\" Ip Item .\" X<> Xref (embedded .\" Of course, you have to process the output yourself .\" in some meaninful fashion. .if \nF \{ .de IX .tm Index:\\$1\t\\n%\t"\\$2" .. .nr % 0 .rr F .\} .TH lib::DBI::FAQ 3 "perl 5.005, patch 03" "1/Jan/1999" "User Contributed Perl Documentation" .UC .if n .hy 0 .if n .na .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .de CQ \" put $1 in typewriter font .ft CW 'if n "\c 'if t \\&\\$1\c 'if n \\&\\$1\c 'if n \&" \\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7 '.ft R .. .\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2 . \" AM - accent mark definitions .bd B 3 . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds ? ? . ds ! ! . ds / . ds q .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10' . ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' . ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#] .ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u' .ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u' .ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#] .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E .ds oe o\h'-(\w'o'u*4/10)'e .ds Oe O\h'-(\w'O'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds v \h'-1'\o'\(aa\(ga' . ds _ \h'-1'^ . ds . \h'-1'. . ds 3 3 . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE . ds oe oe . ds Oe OE .\} .rm #[ #] #H #V #F C .SH "NAME" DBI::FAQ -- The Frequently Asked Questions for the Perl5 Database Interface .SH "SYNOPSIS" .PP .Vb 1 \& perldoc DBI::FAQ .Ve .SH "VERSION" This document is currently at version \fI0.37\fR, as of \fIDecember 30th, 1998\fR. .SH "DESCRIPTION" This document serves to answer the most frequently asked questions on both the DBI Mailing Lists and personally to members of the DBI development team. .SH "Basic Information & Information Sources" .Sh "1.1 What is \s-1DBI\s0, DBperl, Oraperl and *perl?" To quote Tim Bunce, the architect and author of \s-1DBI\s0: .PP .Vb 4 \& ``DBI is a database access Application Programming Interface (API) \& for the Perl Language. The DBI API Specification defines a set \& of functions, variables and conventions that provide a consistent \& database interface independant of the actual database being used.'' .Ve In simple language, the \s-1DBI\s0 interface allows users to access multiple database types transparently. So, if you connecting to an Oracle, Informix, mSQL, Sybase or whatever database, you don't need to know the underlying mechanics of the 3GL layer. The \s-1API\s0 defined by \s-1DBI\s0 will work on \fIall\fR these database types. .PP A similar benefit is gained by the ability to connect to two \fIdifferent\fR databases of different vendor within the one perl script, \fIie\fR, I want to read data from an Oracle database and insert it back into an Informix database all within one program. The \s-1DBI\s0 layer allows you to do this simply and powerfully. .PP \fIDBperl\fR is the old name for the interface specification. It's usually now used to denote perl\fI4\fR modules on database interfacing, such as, \fIoraperl\fR, \fIisqlperl\fR, \fIingperl\fR and so on. These interfaces didn't have a standard \s-1API\s0 and are generally \fInot\fR supported. .PP Here's a list of DBperl modules, their corresponding \s-1DBI\s0 counterparts and support information. \fIPlease note\fR, the author's listed here generally \fIdo not\fR maintain the \s-1DBI\s0 module for the same database. These email addresses are unverified and should only be used for queries concerning the perl4 modules listed below. \s-1DBI\s0 driver queries should be directed to the \fIdbi-users\fR mailing list. .PP .Vb 23 \& Module Name Database Required Author DBI \& ----------- ----------------- ------ --- \& Sybperl Sybase Michael Peppler DBD::Sybase \& <mpeppler@itf.ch> \& Oraperl Oracle 6 & 7 Kevin Stock DBD::Oracle \& <dbi-users@fugue.com> \& Ingperl Ingres Tim Bunce & DBD::Ingres \& Ted Lemon \& <dbi-users@fugue.com> \& Interperl Interbase Buzz Moschetti DBD::Interbase \& <buzz@bear.com> \& Uniperl Unify 5.0 Rick Wargo None \& <rickers@coe.drexel.edu> \& Pgperl Postgres Igor Metz DBD::Pg \& <metz@iam.unibe.ch> \& Btreeperl NDBM John Conover SDBM? \& <john@johncon.com> \& Ctreeperl C-Tree John Conover None \& <john@johncon.com> \& Cisamperl Informix C-ISAM Mathias Koerber None \& <mathias@unicorn.swi.com.sg> \& Duaperl X.500 Directory Eric Douglas None \& User Agent .Ve However, some \s-1DBI\s0 modules have DBperl emulation layers, so, \fI\s-1DBD::\s0Oracle\fR comes with an Oraperl emulation layer, which allows you to run legacy oraperl scripts without modification. The emulation layer translates the oraperl \s-1API\s0 calls into \s-1DBI\s0 calls and executes them through the \s-1DBI\s0 switch. .PP Here's a table of emulation layer information: .PP .Vb 8 \& Module Emulation Layer Status \& ------ --------------- ------ \& DBD::Oracle Oraperl Complete \& DBD::Informix Isqlperl Under development \& DBD::Ingres Ingperl Complete? \& DBD::Sybase Sybperl Working? ( Needs verification ) \& DBD::mSQL Msqlperl Experimentally released with \& DBD::mSQL-0.61 .Ve The \fIMsqlperl\fR emulation is a special case. \fIMsqlperl\fR is a perl5 driver for \fImSQL\fR databases, but does not conform to the \s-1DBI\s0 Specification. It's use is being deprecated in favour of \fI\s-1DBD::\s0mSQL\fR. \fIMsqlperl\fR may be downloaded from \s-1CPAN\s0 \fIvia\fR: .PP .Vb 1 \& http://www.perl.com/cgi-bin/cpan_mod?module=Msqlperl .Ve .Sh "1.2. Where can I get it from?" The Comprehensive Perl Archive Network resources should be used for retrieving up-to-date versions of the \s-1DBI\s0 and drivers. \s-1CPAN\s0 may be accessed \fIvia\fR Tom Christiansen's splendid \fI\s-1CPAN\s0 multiplexer\fR program located at: .PP .Vb 1 \& http://www.perl.com/CPAN/ .Ve For more specific version information and exact URLs of drivers, please see the \s-1DBI\s0 drivers list and the \s-1DBI\s0 module pages which can be found on: .PP .Vb 1 \& http://www.arcana.co.uk/technologia/perl/DBI .Ve .Sh "1.3. Where can I get more information?" There are a few information sources on \s-1DBI\s0. .Ip "\fI\s-1POD\s0 documentation\fR" 4 \fI\s-1POD\s0\fRs are chunks of documentation usually embedded within perl programs that document the code ``\fIin place\fR'\*(R', providing a useful resource for programmers and users of modules. \s-1POD\s0 for \s-1DBI\s0 and drivers is beginning to become more commonplace, and documentation for these modules can be read with the following commands. .Ip "The \s-1DBI\s0 Specification" 8 The \s-1POD\s0 for the \s-1DBI\s0 Specification can be read with the: .Sp .Vb 1 \& perldoc DBI .Ve command. .Ip "Oraperl" 8 Users of the Oraperl emulation layer bundled with \fI\s-1DBD::\s0Oracle\fR, may read up on how to program with the Oraperl interface by typing: .Sp .Vb 1 \& perldoc Oraperl .Ve This will produce an updated copy of the original oraperl man page written by Kevin Stock for perl4. The oraperl \s-1API\s0 is fully listed and described there. .Ip "Drivers" 8 Users of the \s-1DBD\s0 modules may read about some of the private functions and quirks of that driver by typing: .Sp .Vb 1 \& perldoc <driver> .Ve For example, the \fI\s-1DBD::\s0mSQL\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" 8 This document, the \fIFrequently Asked Questions\fR is also available as \s-1POD\s0 documentation! You can read this on your own system by typing: .Sp .Vb 1 \& perldoc DBI::FAQ .Ve This 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 and installed for the more up-to-date version. .Sp The version of \fI\s-1DBI::FAQ\s0\fR shipped with the \f(CWDBI\fR module may be slightly out of date. .Ip "\s-1POD\s0 in general" 8 Information on writing \s-1POD\s0, and on the philosophy of \s-1POD\s0 in general, can be read by typing: .Sp .Vb 1 \& perldoc perlpod .Ve Users with the Tk module installed may be interested to learn there is a Tk-based \s-1POD\s0 reader available called \f(CWtkpod\fR, which formats \s-1POD\s0 in a convenient and readable way. This is available \fIvia\fR \s-1CPAN\s0 as the module called \fITk::\s-1POD\s0\fR and is highly recommended. .Ip "\fIRambles, Tidbits and Observations\fR" 4 .Sp .Vb 1 \& http://www.arcana.co.uk/technologia/perl/DBI/tidbits .Ve There 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 up drafting fairly comprehensive documents. These are quite often varying in quality, but do provide some insights into the workings of the interfaces. .Ip "\fI``\s-1DBI\s0 -- The perl5 Database Interface'\*(T'\fR" 4 This is an article written by Alligator Descartes and Tim Bunce on the structure of \s-1DBI\s0. It was published in issue 5 of ``\fIThe Perl Journal\fR'\*(R'. It's \fIextremely\fR good. Go buy the magazine. In fact, buy all of them! ``The Perl Journal''s \s-1WWW\s0 site is: .Sp .Vb 1 \& http://www.tpj.com .Ve This article has now been placed online thanks to the gracious permission of Jon Orwant, editor of ``The Perl Journal'\*(R'. It can be accessed \fIvia\fR the \s-1WWW\s0 at .Sp .Vb 1 \& http://www.arcana.co.uk/technologia/perl/DBI/doc/tpj5/index.html .Ve The article contains information that is now out of date with regards to the \s-1DBI\s0 1.0 Specification since it was written approximately 2 years ago. \fICaveat Emptor\fR! .Ip "\fI``DBperl'\*(T'\fR" 4 This article, published in the November 1996 edition of ``Dr. Dobbs Journal'\*(R' concerned \fIDBperl\fR. The author of this edition apparently did not bother to contact any of the \s-1DBI\s0 development team members for verification of the information contained within his article. Several reviews of the article on the \fIdbi-users\fR mailing list were disparaging, to say the least. The fact the article was written about \fIDBperl\fR instead of \fI\s-1DBI\s0\fR hints at the staleness of the information. .Sp However, we include the reference for completeness\*(R' sake. .Ip "\fI``The Perl5 Database Interface'\*(T'\fR" 4 This item is a book being written by Alligator Descartes and Tim Bunce and will be published by O'Reilly and Associates early in 1999. .Sp Here is the putative table of contents for the book. .Sp .Vb 43 \& * Introduction \& + Databases \& + CGI / WWW \& + perl \& * Basic Database Concepts \& + Types of Database \& o Flat File \& o AnyDBM \& o RDBMS \& + Using Which Database For What... \& * SQL \& + Why SQL? \& + Structuring Information In Databases \& + Retrieving Data From Databases \& + Manipulating Data and Data Structures \& * DBI Architecture \& * Programming with DBI \& + DBI Initialization \& + Handles \& o Driver Handles \& o Database Handles \& o Statement Handles \& + Connection and Disconnection \& + Handling Errors \& + Issuing Simple Queries \& + Executing Atomic Statements \& + Statement MetaData \& + More perl-ish Statements \& + Binding \& + Transaction Handling \& + Utility Methods \& + Handle Attributes and Dynamic Variables \& * DBI and ODBC \& * The Database Drivers \& + DBD::Oracle and oraperl \& + DBD::Informix and isqlperl \& + DBD::mSQL and Msqlperl \& * Case Studies \& + DBI and the WWW \& + Data Migration and Warehousing \& + Administration Software \& * Appendix: API Reference / Specification \& * Appendix: Resources .Ve The book is currently well underway with around half being written to date and much example code has been written. Please do not pester the authors with ``when will it be coming out?'\*(R' questions. We don't know exactly, but ``soon'\*(R' is a good enough guess. .Ip "\fI\s-1README\s0 files\fR" 4 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. These can all be read from the main \s-1DBI\s0 \s-1WWW\s0 page at: .Sp .Vb 1 \& http://www.arcana.co.uk/technologia/perl/DBI .Ve .Ip "\fIMailing Lists\fR" 4 There are three mailing lists for \s-1DBI\s0 run by Ted Lemon. These can all be subscribed to and unsubscribed from \fIvia\fR the World Wide Web at the \s-1URL\s0 of: .Sp .Vb 1 \& http://www.fugue.com/dbi .Ve The lists that users may participate in are: .Ip "\fIdbi-announce\fR" 8 This mailing list is for announcements only. Very low traffic. The announcements are usually posted on the main \s-1DBI\s0 \s-1WWW\s0 page. .Sp If you cannot successfully use the form on the above \s-1WWW\s0 page, please subscribe to the list in the following manner: .Sp .Vb 2 \& Email: 'dbi-announce-request@fugue.com' with a message body of \& 'subscribe' .Ve .Ip "\fIdbi-dev\fR" 8 This mailing list is intended for the use of developers discussing ideas and concepts for the \s-1DBI\s0 interface, \s-1API\s0 and driver mechanics. Only any use for developers, or interested parties. Low traffic. .Sp If you cannot successfully use the form on the above \s-1WWW\s0 page, please subscribe to the list in the following manner: .Sp .Vb 2 \& Email: 'dbi-dev-request@fugue.com' with a message body of \& 'subscribe' .Ve .Ip "\fIdbi-users\fR" 8 This mailing list is a general discussion list used for bug reporting, problem discussion and general enquiries. Medium traffic. .Sp If you cannot successfully use the form on the above \s-1WWW\s0 page, please subscribe to the list in the following manner: .Sp .Vb 2 \& Email: 'dbi-users-request@fugue.com' with a message body of \& 'subscribe' .Ve .Ip "\fIMailing List Archives\fR" 4 .Ip "\fI\s-1US\s0 Mailing List Archives\fR" 8 .Sp .Vb 1 \& http://outside.organic.com/mail-archives/dbi-users/ .Ve Searchable hypermail archives of the three mailing lists, and some of the much older traffic have been set up for users to browse. .Ip "\fIEuropean Mailing List Archives\fR" 8 .Sp .Vb 1 \& http://www.rosat.mpe-garching.mpg.de/mailing-lists/PerlDB-Interest .Ve As per the \s-1US\s0 archive above. .SH "Compilation Problems" .Sh "2.1. Compilation problems or \*(M"It fails the test!\*(S"" 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\s0 files for each driver in advance online at: .PP .Vb 1 \& http://www.arcana.co.uk/technologia/perl/DBI .Ve If 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 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: .Ip "\(bu" 8 What the problem was, and test cases, if possible. .Ip "\(bu" 8 What you needed to do to fix it. Please make sure you mention everything. .Ip "\(bu" 8 Platform information, database version, perl version, module version and \s-1DBI\s0 version. .Ip "\fIEmail the author\fR Do \fI\s-1NOT\s0\fR whinge!" 4 Please email the address listed in the \s-1WWW\s0 pages for whichever driver you are having problems with. Do \fInot\fR directly email the author at a known address unless it corresponds with the one listed. .Sp We tend to have real jobs to do, and we do read the mailing lists for problems. Besides, we may not have access to <\fIinsert your favourite brain-damaged platform here\fR> and couldn't be of any assistance anyway! Apologies for sounding harsh, but that's the way of it! .Sp However, you might catch one of these creative genii at 3am when we're doing this sort of stuff anyway, and get a patch within 5 minutes. The atmosphere in the \s-1DBI\s0 circle is that we \fIdo\fR appreciate the users\*(R' problems, since we work in similar environments. .Sp If you are planning to email the author, please furnish as much information as possible, \fIie\fR: .Ip "\(bu" 8 \fI\s-1ALL\s0\fR the information asked for in the \s-1README\s0 file in the problematic module. And we mean \fI\s-1ALL\s0\fR of it. We don't put lines like that in documentation for the good of our health, or to meet obscure \s-1README\s0 file standards of length. .Ip "\(bu" 8 If you have a core dump, try the \fIDevel::CoreStack\fR module for generating 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" 8 Module versions, perl version, test cases, operating system versions and \fIany other pertinent information\fR. .Sp Remember, the more information you send us, the quicker we can track problems down. If you send us no useful information, expect nothing back. .Sp Finally, please be aware that some authors, including Tim Bunce, specifically request that you do \fInot\fR mail them directly. Please respect their wishes and use the email addresses listed in the appropriate module \f(CWREADME\fR file. .Ip "\fIEmail the dbi-users Mailing List\fR" 4 It's usually a fairly intelligent idea to \fIcc\fR the mailing list anyway with problems. The authors all read the lists, so you lose nothing by mailing there. .SH "Platform and Driver Issues" .Sh "3.1 What's the difference between \s-1ODBC\s0 and \s-1DBI\s0?" In terms of architecture \- not much: Both define programming interfaces. Both allow multiple drivers to be loaded to do the actual work. .PP In terms of easy of use \- much: The \s-1DBI\s0 is a \*(L'high level\*(R' interface that, like Perl itself, strives to make the simple things easy while still making the hard things possible. The \s-1ODBC\s0 is a \*(L'low level\*(R' interface. All nuts-bolts-knobs-and-dials. .PP Now there's an \s-1ODBC\s0 driver for the \s-1DBI\s0 (\s-1DBD::ODBC\s0) the \*(L"What's the difference\*(R" question is more usefully rephrased as: .Sh "3.2 What's the difference between Win32::\s-1ODBC\s0 and \s-1DBD::ODBC\s0?" The \s-1DBI\s0, and thus \s-1DBD::ODBC\s0, has a different philosophy from the Win32::\s-1ODBC\s0 module: .PP The Win32::\s-1ODBC\s0 module is a \*(L'thin\*(R' layer over the low-level \s-1ODBC\s0 \s-1API\s0. The \s-1DBI\s0 defines a simpler \*(L'higher level\*(R' interface. .PP The Win32::\s-1ODBC\s0 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::\s-1ODBC\s0, the \s-1DBI\s0 and \s-1DBD::ODBC\s0 do support parameter binding and multiple prepared statements which reduces the load on the database server and can dramatically increase performance.) .PP The Win32::\s-1ODBC\s0 module only works on Win32 systems. The \s-1DBI\s0 and \s-1DBD::ODBC\s0 are very portable and work on Win32 and Unix. .PP The \s-1DBI\s0 and \s-1DBD::ODBC\s0 modules are supplied as a standard part of the Perl 5.004 binary distribution for Win32 (they don't work with the older, non-standard, ActiveState port). .PP Scripts written with the \s-1DBI\s0 and \s-1DBD::ODBC\s0 are faster than Win32::\s-1ODBC\s0 on Win32 and are trivially portable to other supported database types. The \s-1DBI\s0 offers optional automatic printing or \fIdie()\fRing on errors which makes applications simpler and more robust. The 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. .PP To summarise: The Win32::\s-1ODBC\s0 module is your best choice if you need access 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. .Sh "3.3 Is \s-1DBI\s0 supported under Windows 95 / \s-1NT\s0 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 the advent of a stabler perl and a port of \fIMakeMaker\fR, the project has come on by great leaps and bounds. .PP The \fI\s-1DBI\s0\fR and \fI\s-1DBD::\s0Oracle\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 \fI\s-1DBD::\s0Oracle\fR version. .Sh "3.4 Can I access Microsoft Access or \s-1SQL\s0\-Server databases with \s-1DBI\s0?" Yes, use the \fI\s-1DBD::ODBC\s0\fR driver. .Sh "3.5 Is the a \s-1DBD\s0 for <\fIinsert favourite database here\fR>?" Is is listed on the \s-1DBI\s0 drivers page? .PP .Vb 1 \& http://www.arcana.co.uk/technologia/perl/DBI .Ve If not, no. A complete absence of a given database driver from that page means that no-one has announced any intention to work on it, not that such a driver is impossible to write. .PP A corollary of the above statement implies that if you see an announcement for a driver \fInot\fR on the above page, there's a good chance it's not actually 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 addressed to the \s-1DBI\s0 Mailing Lists. .Sh "3.6 What's \s-1DBM\s0? And why should I use \s-1DBI\s0 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'', namely \& the dbm system. dbm lets you store data in files, and retrieve \& that data quickly. However, it also has serious drawbacks. .Ve .Vb 1 \& File Locking .Ve .Vb 3 \& The dbm systems did not allow particularly robust file locking \& capabilities, nor any capability for correcting problems arising through \& simultaneous writes [ to the database ]. .Ve .Vb 1 \& Arbitrary Data Structures .Ve .Vb 4 \& 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. .Ve .Vb 5 \& 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.'' .Ve To sum up, \s-1DBM\s0 is a perfectly satisfactory solution for essentially read-only databases, 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. .Sh "3.7 What database do you recommend me using?" This is a particularly thorny area in which an objective answer is difficult to come by, since each dataset, proposed usage and system configuration differs from person to person. .PP From the current author's point of view, if the dataset is relatively small, being tables of less than 1 million rows, and less than 1000 tables in a given database, then \fImSQL\fR is a perfectly acceptable solution to your problem. This database is extremely cheap, is wonderfully robust and has excellent support. More information is available on the Hughes Technology \s-1WWW\s0 site at: .PP .Vb 1 \& http://www.hughes.com.au .Ve You may also wish to look at MySQL which is a more powerful database engine that has a similar feel to mSQL. .PP .Vb 1 \& http://www.tcx.se .Ve If the dataset is larger than 1 million row tables or 1000 tables, or if you have either more money, or larger machines, I would recommend \fIOracle \s-1RDBMS\s0\fR. Oracle's \s-1WWW\s0 site is an excellent source of more information. .PP .Vb 1 \& http://www.oracle.com .Ve \fIInformix\fR is another high-end \s-1RDBMS\s0 that is worth considering. There are several differences between Oracle and Informix which are too complex for this document to detail. Information on Informix can be found on their \s-1WWW\s0 site at: .PP .Vb 1 \& http://www.informix.com .Ve In the case of \s-1WWW\s0 fronted applications, \fImSQL\fR may be a better option due to slow connection times between a \s-1CGI\s0 script and the Oracle \s-1RDBMS\s0 and also the amount of resource each Oracle connection will consume. \fImSQL\fR is lighter resource-wise and faster. .PP These views are not necessarily representative of anyone else's opinions, and do not reflect any corporate sponsorship or views. They are provided \fIas-is\fR. .Sh "3.8 Is <\fIinsert feature here\fR> supported in \s-1DBI\s0?" Given that we're making the assumption that the feature you have requested is a non-standard database-specific feature, then the answer will be \fIno\fR. .PP \s-1DBI\s0 reflects a \fIgeneric\fR \s-1API\s0 that will work for most databases, and has no database-specific functionality. .PP However, driver authors may, if they so desire, include hooks to database-specific functionality through the \f(CWfunc()\fR method defined in the \s-1DBI\s0 \s-1API\s0. Script developers should note that use of functionality provided \fIvia\fR the \f(CWfunc()\fR methods is very unlikely to be portable across databases. .SH "Programming Questions" .Sh "4.1 Is \s-1DBI\s0 any use for \s-1CGI\s0 programming?" In a word, yes! \s-1DBI\s0 is hugely useful for \s-1CGI\s0 programming! In fact, I would tentatively say that \s-1CGI\s0 programming is one of two top uses for \s-1DBI\s0. .PP \s-1DBI\s0 confers the ability to \s-1CGI\s0 programmers to power \s-1WWW\s0\-fronted databases to their users, which provides users with vast quantities of ordered data to play with. \s-1DBI\s0 also provides the possibility that, if a site is receiving far too much traffic than their database server can cope with, they can upgrade the database server behind the scenes with no alterations to the \s-1CGI\s0 scripts. .Sh "4.2 How do I get faster connection times with \s-1DBD::\s0Oracle and \s-1CGI\s0?" .PP .Vb 1 \& Contributed by John D. Groenveld .Ve The Apache \f(CWhttpd\fR maintains a pool of \f(CWhttpd\fR children to service client requests. .PP Using the Apache \fImod_perl\fR module by \fIDoug MacEachern\fR, the perl interpreter is embedded with the \f(CWhttpd\fR children. The \s-1CGI\s0, \s-1DBI\s0, and your other favorite modules can be loaded at the startup of each child. These modules will not be reloaded unless changed on disk. .PP For more information on Apache, see the Apache Project's \s-1WWW\s0 site: .PP .Vb 1 \& http://www.apache.org .Ve The \fImod_perl\fR module can be downloaded from \s-1CPAN\s0 \fIvia\fR: .PP .Vb 1 \& http://www.perl.com/cgi-bin/cpan_mod?module=Apache .Ve .Sh "4.3 How do I get persistent connections with \s-1DBI\s0 and \s-1CGI\s0?" .PP .Vb 1 \& Contributed by John D. Groenveld .Ve Using Edmund Mergl's \fIApache::\s-1DBI\s0\fR module, database logins are stored in a hash with each of these \f(CWhttpd\fR child. If your application is based on a single database user, this connection can be started with each child. Currently, database connections cannot be shared between \f(CWhttpd\fR children. .PP \fIApache::\s-1DBI\s0\fR can be downloaded from \s-1CPAN\s0 \fIvia\fR: .PP .Vb 1 \& http://www.perl.com/cgi-bin/cpan_mod?module=Apache::DBI .Ve .Sh "4.4 ``When I run a perl script from the command line, it works, but, when I run it under the \f(CWhttpd\fR, it fails!'\*(S' Why?" Basically, a good chance this is occurring is due to the fact that the user that you ran it from the command line as has a correctly configured set of environment variables, in the case of \fI\s-1DBD::\s0Oracle\fR, variables like \f(CWORACLE_HOME\fR, \f(CWORACLE_SID\fR or \f(CWTWO_TASK\fR. .PP The \f(CWhttpd\fR process usually runs under the user id of \f(CWnobody\fR, which implies there is no configured environment. Any scripts attempting to execute in this situation will correctly fail. .PP One way to solve this problem is to set the environment for your database in a \f(CWBEGIN { }\fR block at the top of your script. Another technique is to configure your \s-1WWW\s0 server to pass-through certain environment variables to your \s-1CGI\s0 scripts. .PP Similarly, you should check your \f(CWhttpd\fR error logfile for any clues, as well as the ``Idiot's Guide To Solving Perl / \s-1CGI\s0 Problems'\*(R' and ``Perl \s-1CGI\s0 Programming \s-1FAQ\s0'\*(R' for further information. It is unlikely the problem is \s-1DBI\s0\-related. .PP The ``Idiot's Guide To Solving Perl / \s-1CGI\s0 Problems'\*(R' can be located at: .PP .Vb 1 \& http://www.perl.com/perl/faq/index.html .Ve as can the ``Perl \s-1CGI\s0 Programming \s-1FAQ\s0'\*(R'. Read \fI\s-1BOTH\s0\fR these documents carefully! .Sh "4.5 How do I get the number of rows returned from a \f(CWSELECT\fR statement?" Count them. Read the \s-1DBI\s0 docs for the \f(CWrows()\fR method. .SH "Miscellaneous Questions" .Sh "5.1 Can I do multi-threading with \s-1DBI\s0?" Perl version 5.005 and later can be built to support multi-threading. The \s-1DBI\s0, as of version 1.02, does not yet support multi-threading so it would be unsafe to let more than one thread enter the \s-1DBI\s0 at the same time. .PP It is expected that some future version of the \s-1DBI\s0 will at least be thread-safe (but not thread-hot) by automatically blocking threads intering the \s-1DBI\s0 while it's already in use. .PP For some \s-1OCI\s0 example code for Oracle that has multi-threaded \f(CWSELECT\fR statements, see: .PP .Vb 1 \& http://www.arcana.co.uk/technologia/oracle/oci/orathreads.tar.gz .Ve .Sh "5.2 How do I handle \s-1BLOB\s0 data with \s-1DBI\s0?" If the \s-1BLOB\s0 can fit into your memory then setting the LongReadLen attribute to a large enough value should be sufficient. If not, ... To be written. .Sh "5.3 How can I invoke stored procedures with \s-1DBI\s0?" The \s-1DBI\s0 does not define a database-independent way of calling stored procedures. .PP However, most database that support them also provide a way to call them from \s-1SQL\s0 statements \- and the \s-1DBI\s0 certainly supports that. .PP So, assuming that you have created a stored procedure within the target database, \fIeg\fR, an Oracle database, you can use \f(CW$dbh\fR\->\f(CWdo()\fR to immediately execute the procedure. For example, .PP .Vb 1 \& $dbh->do( "BEGIN someProcedure; END;" ); # Oracle-specific .Ve You should also be able to \f(CWprepare\fR and \f(CWexecute\fR, which is the recommended way if you'll be calling the procedure often. .Sh "5.4 How can I get return values from stored procedures with \s-1DBI\s0?" .PP .Vb 1 \& Contributed by Jeff Urlwin .Ve .Vb 5 \& $sth = $dbh->prepare( "BEGIN foo(:1, :2, :3); END;" ); \& $sth->bind_param(1, $a); \& $sth->bind_param_inout(2, \e$path, 2000); \& $sth->bind_param_inout(3, \e$success, 2000); \& $sth->execute; .Ve Remember to perform error checking, though! ( Or use the \f(CWRaiseError\fR attribute ). .Sh "5.5 How can I create or drop a database with \s-1DBI\s0?" Database creation and deletion are concepts that are entirely too abstract to be adequately supported by \s-1DBI\s0. For example, Oracle does not support the concept of dropping a database at all! Also, in Oracle, the database \fIserver\fR essentially \fIis\fR the database, whereas in mSQL, the server process runs happily without any databases created in it. The problem is too disparate to attack in a worthwhile way. .PP Some drivers, therefore, support database creation and deletion through the private \f(CWfunc()\fR methods. You should check the documentation for the drivers you are using to see if they support this mechanism. .Sh "5.6 How can I \f(CWcommit\fR or \f(CWrollback\fR a statement with \s-1DBI\s0?" See the \f(CWcommit()\fR and \f(CWrollback()\fR methods in the \s-1DBI\s0 docs. .Sh "5.7 How are \f(CWNULL\fR values handled by \s-1DBI\s0?" \f(CWNULL\fR values in \s-1DBI\s0 are specified to be treated as the value \f(CWundef\fR. \f(CWNULL\fRs can be inserted into databases as \f(CWNULL\fR, for example: .PP .Vb 1 \& $rv = $dbh->do( "INSERT INTO table VALUES( NULL )" ); .Ve but when queried back, the \f(CWNULL\fRs should be tested against \f(CWundef\fR. This is standard across all drivers. .Sh "5.8 What are these \f(CWfunc()\fR methods all about?" The \f(CWfunc()\fR method is defined within \s-1DBI\s0 as being an entry point for database-specific functionality, \fIeg\fR, the ability to create or drop databases. Invoking these driver-specific methods is simple, for example, to invoke a \f(CWcreateDatabase\fR method that has one argument, we would write: .PP .Vb 1 \& $rv =$dbh->func( 'argument', 'createDatabase' ); .Ve Software developers should note that the \f(CWfunc()\fR methods are non-portable between databases. .Sh "5.9 Is \s-1DBI\s0 Year 2000 Compliant?" \s-1DBI\s0 has no knowledge of understanding of what dates are. Therefore, \s-1DBI\s0 itself does not have a Year 2000 problem. Individual drivers may use date handling code internally and therefore be potentially susceptible to the Year 2000 problem, but this is unlikely. .PP You may also wish to read the ``Does Perl have a Year 2000 problem?'\*(R' section of the Perl \s-1FAQ\s0 at: .PP .Vb 1 \& http://www.perl.com/CPAN/doc/FAQs/FAQ/PerlFAQ.html .Ve .SH "Support and Training" The Perl5 Database Interface is \fIFREE\fR software. IT COMES WITHOUT WARRANTY OF ANY KIND. See the DBI README for more details. .PP However, some organizations are providing either technical support or training programs on DBI. The present author has no knowledge as to the quality of these services. The links are included for reference purposes only and should not be regarded as recommendations in any way. \fICaveat emptor\fR. .Sh "Commercial Support" .Ip "The Perl Clinic" 4 The Perl Clinic provides commercial support for \fIPerl\fR and Perl related problems, including the \fI\s-1DBI\s0\fR and its drivers. Support is provided by the company with whom Tim Bunce, author of \fI\s-1DBI\s0\fR and \fI\s-1DBD::\s0Oracle\fR, works and ActiveState. For more information on their services, please see: .Sp .Vb 1 \& http://www.perlclinic.com .Ve .Sh "Training" .Ip "Westlake Solutions" 4 A hands-on class for experienced Perl \s-1CGI\s0 developers that teaches how to write database-connected \s-1CGI\s0 scripts using Perl and \s-1DBI\s0.pm. This course, along with four other courses on \s-1CGI\s0 scripting with Perl, is taught in Washington, \s-1DC\s0; Arlington, Virginia; and on-site worldwide upon request. .Sp See: .Sp .Vb 1 \& http://www.westlake.com/training .Ve for more details. .SH "Other References" In this section, we present some miscellaneous WWW links that may be of some interest to DBI users. These are not verified and may result in unknown sites or missing documents. .PP .Vb 3 \& http://www-ccs.cs.umass.edu/db.html \& http://www.odmg.org/odmg93/updates_dbarry.html \& http://www.jcc.com/sql_stnd.html .Ve .SH "AUTHOR" Alligator Descartes <\fIdescarte@arcana.co.uk\fR>. Portions are Copyright their original stated authors. .SH "COPYRIGHT" This document is Copyright (c)1994-1999 Alligator Descartes, with portions Copyright (c)1994-1999 their original authors. This module is released under the \*(L'Artistic\*(R' license which you can find in the perl distribution. .PP This document is Copyright (c)1997-1999 Alligator Descartes. All rights reserved. Permission to distribute this document, in full or in part, via email, Usenet, ftp archives or http is granted providing that no charges are involved, reasonable attempt is made to use the most current version and all credits and copyright notices are retained ( the \fIAUTHOR\fR and \fICOPYRIGHT\fR sections ). Requests for other distribution rights, including incorporation into commercial products, such as books, magazine articles or CD\-ROMs should be made to Alligator Descartes <\fIdescarte@arcana.co.uk\fR>. .rn }` '' .IX Title "lib::DBI::FAQ 3" .IX Name "DBI::FAQ - The Frequently Asked Questions for the Perl5 Database Interface" .IX Header "NAME" .IX Header "SYNOPSIS" .IX Header "VERSION" .IX Header "DESCRIPTION" .IX Header "Basic Information & Information Sources" .IX Subsection "1.1 What is \s-1DBI\s0, DBperl, Oraperl and *perl?" .IX Subsection "1.2. Where can I get it from?" .IX Subsection "1.3. Where can I get more information?" .IX Item "\fI\s-1POD\s0 documentation\fR" .IX Item "The \s-1DBI\s0 Specification" .IX Item "Oraperl" .IX Item "Drivers" .IX Item "Frequently Asked Questions" .IX Item "\s-1POD\s0 in general" .IX Item "\fIRambles, Tidbits and Observations\fR" .IX Item "\fI``\s-1DBI\s0 -- The perl5 Database Interface'\*(T'\fR" .IX Item "\fI``DBperl'\*(T'\fR" .IX Item "\fI``The Perl5 Database Interface'\*(T'\fR" .IX Item "\fI\s-1README\s0 files\fR" .IX Item "\fIMailing Lists\fR" .IX Item "\fIdbi-announce\fR" .IX Item "\fIdbi-dev\fR" .IX Item "\fIdbi-users\fR" .IX Item "\fIMailing List Archives\fR" .IX Item "\fI\s-1US\s0 Mailing List Archives\fR" .IX Item "\fIEuropean Mailing List Archives\fR" .IX Header "Compilation Problems" .IX Subsection "2.1. Compilation problems or \*(M"It fails the test!\*(S"" .IX Item "\fIAttempt to fix it yourself\fR" .IX Item "\(bu" .IX Item "\(bu" .IX Item "\(bu" .IX Item "\fIEmail the author\fR Do \fI\s-1NOT\s0\fR whinge!" .IX Item "\(bu" .IX Item "\(bu" .IX Item "\(bu" .IX Item "\fIEmail the dbi-users Mailing List\fR" .IX Header "Platform and Driver Issues" .IX Subsection "3.1 What's the difference between \s-1ODBC\s0 and \s-1DBI\s0?" .IX Subsection "3.2 What's the difference between Win32::\s-1ODBC\s0 and \s-1DBD::ODBC\s0?" .IX Subsection "3.3 Is \s-1DBI\s0 supported under Windows 95 / \s-1NT\s0 platforms?" .IX Subsection "3.4 Can I access Microsoft Access or \s-1SQL\s0\-Server databases with \s-1DBI\s0?" .IX Subsection "3.5 Is the a \s-1DBD\s0 for <\fIinsert favourite database here\fR>?" .IX Subsection "3.6 What's \s-1DBM\s0? And why should I use \s-1DBI\s0 instead?" .IX Subsection "3.7 What database do you recommend me using?" .IX Subsection "3.8 Is <\fIinsert feature here\fR> supported in \s-1DBI\s0?" .IX Header "Programming Questions" .IX Subsection "4.1 Is \s-1DBI\s0 any use for \s-1CGI\s0 programming?" .IX Subsection "4.2 How do I get faster connection times with \s-1DBD::\s0Oracle and \s-1CGI\s0?" .IX Subsection "4.3 How do I get persistent connections with \s-1DBI\s0 and \s-1CGI\s0?" .IX Subsection "4.4 ``When I run a perl script from the command line, it works, but, when I run it under the \f(CWhttpd\fR, it fails!'\*(S' Why?" .IX Subsection "4.5 How do I get the number of rows returned from a \f(CWSELECT\fR statement?" .IX Header "Miscellaneous Questions" .IX Subsection "5.1 Can I do multi-threading with \s-1DBI\s0?" .IX Subsection "5.2 How do I handle \s-1BLOB\s0 data with \s-1DBI\s0?" .IX Subsection "5.3 How can I invoke stored procedures with \s-1DBI\s0?" .IX Subsection "5.4 How can I get return values from stored procedures with \s-1DBI\s0?" .IX Subsection "5.5 How can I create or drop a database with \s-1DBI\s0?" .IX Subsection "5.6 How can I \f(CWcommit\fR or \f(CWrollback\fR a statement with \s-1DBI\s0?" .IX Subsection "5.7 How are \f(CWNULL\fR values handled by \s-1DBI\s0?" .IX Subsection "5.8 What are these \f(CWfunc()\fR methods all about?" .IX Subsection "5.9 Is \s-1DBI\s0 Year 2000 Compliant?" .IX Header "Support and Training" .IX Subsection "Commercial Support" .IX Item "The Perl Clinic" .IX Subsection "Training" .IX Item "Westlake Solutions" .IX Header "Other References" .IX Header "AUTHOR" .IX Header "COPYRIGHT"
Simpan