?? postgresql-howto-11.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"> <META NAME="GENERATOR" CONTENT="ZH-SGML-Tools 1.0.9"> <TITLE> Linux 的 Database-SQL-RDBMS HOW-TO 文件 (PostgreSQL 物件關(guān)聯(lián)資料庫系統(tǒng)): PostgreSQL 的 Perl 資料庫介面 (Database Interface, DBI) </TITLE> <LINK HREF="PostgreSQL-HOWTO-12.html" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO-12.html" REL=next> <LINK HREF="PostgreSQL-HOWTO-10.html" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO-10.html" REL=previous> <LINK HREF="PostgreSQL-HOWTO.html#toc11" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO.html#toc11" REL=contents><SCRIPT src="menu.js"> function BeginPage() {} function EndPage() {} </SCRIPT> </HEAD> <BODY bgcolor=#FFFFFF MARGINHEIGHT=0 MARGINWIDTH=0> <A HREF="PostgreSQL-HOWTO-12.html" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO-12.html"><IMG SRC="next.gif" tppabs="http://www.linux.org.tw/CLDP/gb/img/next.gif" ALT="Next"></A><A HREF="PostgreSQL-HOWTO-10.html" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO-10.html"><IMG SRC="prev.gif" tppabs="http://www.linux.org.tw/CLDP/gb/img/prev.gif" ALT="Previous"></A><A HREF="PostgreSQL-HOWTO.html#toc11" tppabs="http://www.linux.org.tw/CLDP/gb/PostgreSQL-HOWTO.html#toc11"><IMG SRC="toc.gif" tppabs="http://www.linux.org.tw/CLDP/gb/img/toc.gif" ALT="Contents"></A><HR><H2><A NAME="Perl Database Interface"></A> <A NAME="s11">11. PostgreSQL 的 Perl 資料庫界面 (Database Interface, DBI) </A></H2><P><H2><A NAME="ss11.1">11.1 PostgreSQL 的 PERL 5 界面</A></H2><P>PERL 是‘Practical Exptraction and Report Language’的簡寫。世上所有軟硬件平臺都可使用 Perl。你所在視窗 95/NT、蘋果麥金塔 iMac、所有 Unix (Solaris、HPUX、AIX、Linux、Irix、SCO 等等)、大型電腦 MVS、桌面的 OS/2、OS/400、Amdahl UTS 和其他很多電腦。Perl <B>甚至</B>可在很多不流行和不為人知的操作系統(tǒng)和硬件執(zhí)行!!所以,在看到 Perl 在一個(gè)罕見的操作系統(tǒng)上執(zhí)行時(shí),不必大驚小怪。你可以想像到 Perl 的使用者和開發(fā)人員的數(shù)量。<P>PostgreSQL 的 Perl 界面已包括在 PostgreSQL 的散布中。請參看 src/pgsql_perl5 目錄。<UL><LI> Pgsql_perl5 電郵聯(lián)絡(luò)地址∶<A HREF="mailto:E.Mergl@bawue.de">E.Mergl@bawue.de</A></LI><LI>另一資料來源∶<A HREF="javascript:if(confirm('ftp://ftp.kcilink.com/pub/PostgresPerl-1.3.tar.gz \n\nThis file was not retrieved by Teleport Pro, because it did not meet the project\'s file type specifications. \n\nDo you want to open it from the server?'))window.location='ftp://ftp.kcilink.com/pub/PostgresPerl-1.3.tar.gz'" tppabs="ftp://ftp.kcilink.com/pub/PostgresPerl-1.3.tar.gz">ftp://ftp.kciLink.com/pub/PostgresPerl-1.3.tar.gz</A></LI><LI> Perl 網(wǎng)頁<A HREF="javascript:if(confirm('http://www.perl.com/perl/index.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.perl.com/perl/index.html'" tppabs="http://www.perl.com/perl/index.html">http://www.perl.com/perl/index.html</A></LI><LI> Perl 導(dǎo)引,請?jiān)?<A HREF="javascript:if(confirm('http://reference.perl.com/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://reference.perl.com/'" tppabs="http://reference.perl.com/">http://reference.perl.com/</A> 參看導(dǎo)引目錄</LI><LI> Perl FAQ 在 <A HREF="javascript:if(confirm('http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/'" tppabs="http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/">http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/</A></LI><LI> Perl GUI 使用者界面 Perl-Qt rpm∶<A HREF="javascript:if(confirm('ftp://ftp.redhat.com/pub/contrib/i386 \n\nThis file was not retrieved by Teleport Pro, because it did not meet the project\'s file type specifications. \n\nDo you want to open it from the server?'))window.location='ftp://ftp.redhat.com/pub/contrib/i386'" tppabs="ftp://ftp.redhat.com/pub/contrib/i386">ftp://ftp.redhat.com/pub/contrib/i386</A> 也請看 PerlQt-1.06-1.i386.rpm</LI><LI> Perl GUI 使用者界面 Perl-Qt∶<A HREF="javascript:if(confirm('http://www.accessone.com/~jql/perlqt.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.accessone.com/~jql/perlqt.html'" tppabs="http://www.accessone.com/~jql/perlqt.html">http://www.accessone.com/~jql/perlqt.html</A></LI><LI> Perl GUI 使用者界面 Perl-XForms∶<A HREF="javascript:if(confirm('ftp://ftp.redhat.com/pub/contrib/i386 \n\nThis file was not retrieved by Teleport Pro, because it did not meet the project\'s file type specifications. \n\nDo you want to open it from the server?'))window.location='ftp://ftp.redhat.com/pub/contrib/i386'" tppabs="ftp://ftp.redhat.com/pub/contrib/i386">ftp://ftp.redhat.com/pub/contrib/i386</A>,尋找 Xforms4Perl-0.8.4-1.i386.rpm</LI><LI> Perl GUI 使用者界面 Perl-Tk∶<A HREF="javascript:if(confirm('ftp://ftp.redhat.com/pub/contrib/i386 \n\nThis file was not retrieved by Teleport Pro, because it did not meet the project\'s file type specifications. \n\nDo you want to open it from the server?'))window.location='ftp://ftp.redhat.com/pub/contrib/i386'" tppabs="ftp://ftp.redhat.com/pub/contrib/i386">ftp://ftp.redhat.com/pub/contrib/i386</A></LI><LI> Perl GUIkits∶<A HREF="javascript:if(confirm('http://reference.perl.com/query.cgi?ui \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://reference.perl.com/query.cgi?ui'" tppabs="http://reference.perl.com/query.cgi?ui">http://reference.perl.com/query.cgi?ui</A></LI><LI> Perl 資料庫界面∶<A HREF="javascript:if(confirm('http://reference.perl.com/query.cgi?database \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://reference.perl.com/query.cgi?database'" tppabs="http://reference.perl.com/query.cgi?database">http://reference.perl.com/query.cgi?database</A></LI><LI> Perl 到 "C" 的翻譯工具∶<A HREF="javascript:if(confirm('http://www.perl.com/CPAN-local/modules/by-module/B/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.perl.com/CPAN-local/modules/by-module/B/'" tppabs="http://www.perl.com/CPAN-local/modules/by-module/B/">http://www.perl.com/CPAN-local/modules/by-module/B/</A>尋找 Compiler-a3.tar.gz</LI><LI> Bourne shell 到 Perl 的翻譯工具∶<A HREF="javascript:if(confirm('http://www.perl.com/CPAN/authors/id/MERLYN/sh2perl-0.02.tar.gz \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.perl.com/CPAN/authors/id/MERLYN/sh2perl-0.02.tar.gz'" tppabs="http://www.perl.com/CPAN/authors/id/MERLYN/sh2perl-0.02.tar.gz">http://www.perl.com/CPAN/authors/id/MERLYN/sh2perl-0.02.tar.gz</A></LI><LI> awk 到 perl 的 a2p 和 sed 到 perl 的 s2p 已包括在 PERL 散布中。</LI><LI> 也請看 comp.lang.perl.* 等有關(guān) PERL 的新聞組</LI></UL><H2><A NAME="ss11.2">11.2 Perl 資料庫界面 DBI</A></H2><H3>何謂 DBI?</H3><P>Perl 資料庫界面(DBI)是 Perl 語言的一個(gè)資料庫存取應(yīng)用程序界面(API)。Perl DBI API 規(guī)格定義了一組函數(shù)、變數(shù)和慣例,以提供一個(gè)一致而獨(dú)立于實(shí)際所用的資料庫界面。有關(guān) DBI 的這一段的資料是來自‘DBI FAQ’文件,作者是 Alligator Descartes,并獲準(zhǔn)在此復(fù)制。<UL><LI> Alligator Descartes Hermetica 在 <A HREF="mailto:descarte@hermetica.com">descarte@hermetica.com</A></LI></UL><H3>PostgreSQL 的 DBI 驅(qū)動程序 DBD-Pg-0.89</H3><P>在此取得 DBD-Pg-0.89.tar.gz∶<UL><LI> DBD-Pg-0.89 : <A HREF="javascript:if(confirm('http://www.perl.com/CPAN/modules/by-module/DBD/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.perl.com/CPAN/modules/by-module/DBD/'" tppabs="http://www.perl.com/CPAN/modules/by-module/DBD/">http://www.perl.com/CPAN/modules/by-module/DBD/</A></LI><LI>Comprehensive Perl Archive Network CPAN <A HREF="javascript:if(confirm('http://www.perl.com/CPAN \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.perl.com/CPAN'" tppabs="http://www.perl.com/CPAN">http://www.perl.com/CPAN</A></LI><LI> DBI 驅(qū)動程序名單和 DBI 模塊網(wǎng)頁 <A HREF="javascript:if(confirm('http://www.hermetica.com/technologia/perl/DBI \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.hermetica.com/technologia/perl/DBI'" tppabs="http://www.hermetica.com/technologia/perl/DBI">http://www.hermetica.com/technologia/perl/DBI</A></LI><LI> DBI 的資料在 <A HREF="javascript:if(confirm('http://www.fugue.com/dbi/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.fugue.com/dbi/'" tppabs="http://www.fugue.com/dbi/">http://www.fugue.com/dbi/</A></LI><LI> 主網(wǎng)頁 <A HREF="javascript:if(confirm('ftp://ftp.demon.co.uk/pub/perl/db \n\nThis file was not retrieved by Teleport Pro, because it did not meet the project\'s file type specifications. \n\nDo you want to open it from the server?'))window.location='ftp://ftp.demon.co.uk/pub/perl/db'" tppabs="ftp://ftp.demon.co.uk/pub/perl/db">ftp://ftp.demon.co.uk/pub/perl/db</A></LI><LI> 雜錦 DBI 連結(jié) <A HREF="javascript:if(confirm('http://www-ccs.cs.umass.edu/db.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www-ccs.cs.umass.edu/db.html'" tppabs="http://www-ccs.cs.umass.edu/db.html">http://www-ccs.cs.umass.edu/db.html</A></LI><LI> 雜錦 DBI 連結(jié) <A HREF="javascript:if(confirm('http://www.odmg.org/odmg93/updates_dbarry.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.odmg.org/odmg93/updates_dbarry.html'" tppabs="http://www.odmg.org/odmg93/updates_dbarry.html">http://www.odmg.org/odmg93/updates_dbarry.html</A></LI><LI> 雜錦 DBI 連結(jié) <A HREF="javascript:if(confirm('http://www.jcc.com/sql_stnd.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.jcc.com/sql_stnd.html'" tppabs="http://www.jcc.com/sql_stnd.html">http://www.jcc.com/sql_stnd.html</A></LI><LI>PostgreSQL 資料庫 <A HREF="javascript:if(confirm('http://www.postgresql.org/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.postgresql.org/'" tppabs="http://www.postgresql.org/">http://www.postgresql.org</A></LI></UL><P>系統(tǒng)需求∶<UL><LI> - 建立、測試和安裝 Perl 5 (最少 5.002)</LI><LI> - 建立、測試和安裝 DBI 模塊 (最少 0.89)</LI><LI> - 建立、測試和安裝 PostgreSQL (最少 6.2)</LI></UL><H3>DBI 的技術(shù)支持</H3><P>請把意見和錯(cuò)誤報(bào)告寄到<UL><LI> <A HREF="mailto:E.Mergl@bawue.de">E.Mergl@bawue.de</A></LI></UL><P>請把以 perl -v、perl -V 的輸出、PostgreSQL 的版本、DBD-Pg 的版本、DBI 的版本包括在錯(cuò)誤報(bào)告中。<P><H3>何謂 DBI、DBperl、Oraperl 和 *perl?</H3><P>摘錄自 Tim Bunce,DBI 的設(shè)計(jì)者和作者∶<P>“DBI 是 Perl 語言的一種應(yīng)用程序界面(API)。Perl DBI API 規(guī)格定義了一組函數(shù)、變數(shù)和慣例,用于提供一個(gè)一致而獨(dú)立于實(shí)際所用的資料庫界面。”<P>簡單地說,DBI 容許用家透明地 (transparently) 存取多種資料庫。所以,如果你連接到 Oracle、Informix、mSQL、Sybase 或任何資料庫,你不需要知道 3GL 層面內(nèi)里的機(jī)制。DBI 所定義的 API 可用于所有這些資料庫。<P>這樣的好處是你得到在一篇 perl 手稿中連接兩個(gè)不同出版商不同的資料庫,例如在一個(gè)程序中讀取在一個(gè) Oracle 資料庫的資料及將它插入到 Informix 資料庫中。DBI 層面容許你簡單及有力地做到。<P>DBperl 是這個(gè)界面規(guī)格的舊名。它現(xiàn)在一般用于代表用于 perl4 的資料庫界面模塊,如oraperl、isqlperl、ingperl 之類。這些界面沒有標(biāo)準(zhǔn)的 API,一般已沒有支持。<P>這是 DBperl 模塊的名單,所對應(yīng)的 DBI 模塊及技術(shù)支持信息。有關(guān) DBI 驅(qū)動程序的問題應(yīng)該在 dbi-users 通訊論壇提出。list.<BLOCKQUOTE><CODE><PRE> 模塊名稱 所需資料庫 作者 DBI ----------- ----------------- ------ --- Sybperl Sybase Michael Peppler DBD::Sybase <mpeppler@datamig.com> http://www.mbay.net/~mpeppler Oraperl Oracle 6 & 7 Kevin Stock DBD::Oracle <dbi-users@fugue.com> Ingperl Ingres Tim Bunce & DBD::Ingres
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -