DBI-1.612 > DBI::FAQ

名前

DBI::FAQ -- The Frequently Asked Questions for the Perl5 Database Interface

DBI::FAQ -- Perl 5 データベースインターフェースに対するよくある質問

DBI Frequently Asked Questions v.0.38
Last updated: February 8th, 2000

概要

    perldoc DBI::FAQ

VERSION

This document is currently at version 0.38, as of February 8th, 2000.

このドキュメントは現在 2000 年 2 月 8 日 のバージョン 0.38 です。

That's very old. A newer FAQ can be found at http://faq.dbi-support.com/

これは とても 古いです。 より新しい FAQ は http://faq.dbi-support.com/ にあります。

説明

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.

このドキュメントは DBI メーリングリストや DBI 開発チームのメンバーに 個人的によせられたもののうち、特に頻繁に訊ねられた質問に対する回答を 提供します。

基本的な情報と情報源

1.1 DBI、DBperl、Oraperl、*perl って何ですか?

To quote Tim Bunce, the architect and author of DBI:

DBI の設計者にして作者である Tim Bunce の言葉を借りれば:

    ``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.''

    DBI は、Perl 言語のためのアプリケーション・プログラミング・インターフェース
    (API)です。DBI は関数、変数、規約などを定義し、実際に使われている
    データベースに依存しない一貫性のあるデータベース・インターフェースを
    提供します。

In simple language, the DBI 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 API defined by DBI will work on all these database types.

簡単にいえば、DBI インターフェースは複数のデータベース種類へ透過的に アクセスすることを可能にします。 そのため Oracle、informix、mSQL、Sybase などデータベースであればなんで あっても接続していれば、3GL レイヤでの仕組みについて知る必要はありません。 DBI で定義されてる API はすべてのこれら すべての データベースで機能します。

A similar benefit is gained by the ability to connect to two different databases of different vendor within the one perl script, ie, I want to read data from an Oracle database and insert it back into an Informix database all within one program. The DBI layer allows you to do this simply and powerfully.

同じ様な利点として、二つの異なるベンダーの 異なる データベースに 一つのPerlスクリプトで接続できる、つまり Oracle データベースから データを読み込み、Informix データベースに入れるのをやりたいといったことを 一つのプログラムで可能です。 DBI レイヤは簡単にそして強力にこれをできるようにします。

Here's a diagram that demonstrates the principle:

[ DBI Architecture ]

DBperl is the old name for the interface specification. It's usually now used to denote perl4 modules on database interfacing, such as, oraperl, isqlperl, ingperl and so on. These interfaces didn't have a standard API and are generally not supported.

DBperl はインターフェース仕様の古い名前です。 今では普通 oraperl, isqlperl, ingperl などのような、 perl4 モジュールを示すために使われます。 これらのインタフェースは標準となる API を持っておらず、通常 サポートされていません

Here's a list of DBperl modules, their corresponding DBI counterparts and support information. Please note, the author's listed here generally do not maintain the DBI module for the same database. These email addresses are unverified and should only be used for queries concerning the perl4 modules listed below. DBI driver queries should be directed to the dbi-users mailing list.

DBPerl モジュール、対応する DBI、そしてサポート情報の一覧を以下に示します。 この一覧にある作者が、通常、同じデータベースの DBI モジュールを メンテナンスしているというわけではないことに ご注意下さい。 これらの E メールアドレスは未確認ですし、以下の一覧にある Perl4 モジュールに ついての問い合わせにだけ使って下さい。 DBI ドライバの問い合わせは dbi-users メーリングリストへお願いします。

    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@perl.org>
    Ingperl     Ingres              Tim Bunce &     DBD::Ingres
                                    Ted Lemon
                                    <dbi-users@perl.org>
    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

However, some DBI modules have DBperl emulation layers, so, DBD::Oracle comes with an Oraperl emulation layer, which allows you to run legacy oraperl scripts without modification. The emulation layer translates the oraperl API calls into DBI calls and executes them through the DBI switch.

しかしながら、いくつかの DBI モジュールは DBPerl エミュレーションレイヤを 持っています。 そのため DBD::Oracle は Oraperl エミュレーションレイヤを提供しています。 これで古い oraperl スクリプトを修正なしに動かすことが出来ます。 エミュレーションレイヤは oraperl API 呼び出しを DBI 呼び出しに変換し、 DBI スイッチを通して実行します。

Here's a table of emulation layer information:

エミュレーションレイヤの一覧を以下の表に示します:

    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

The Msqlperl emulation is a special case. Msqlperl is a perl5 driver for mSQL databases, but does not conform to the DBI Specification. It's use is being deprecated in favour of DBD::mSQL. Msqlperl may be downloaded from CPAN via:

Msqlperl エミュレーションは特殊なケースです。 MsqlperlmSQL データベースのための Perl5 ドライバですが、DBI 仕様に 従っていません。 これを使うことは DBD::mSQL の利点に反しています。 Msqlperl は CPAN の このアドレス からダウンロードすることができます:

    http://www.perl.com/cgi-bin/cpan_mod?module=Msqlperl

1.2. どこで手に入りますか?

The Comprehensive Perl Archive Network resources should be used for retrieving up-to-date versions of the DBI and drivers. CPAN may be accessed via Tom Christiansen's splendid CPAN multiplexer program located at:

Comprehensive Perl Archive Network リソースが、DBI とドライバの 最新バージョンが取得されるために使えます。 CPAN には、以下のアドレスにある Tom Christiansen のすばらしい CPAN multiplexer プログラムを 通じても アクセスすることができます:

    http://www.perl.com/CPAN/

For more specific version information and exact URLs of drivers, please see the DBI drivers list and the DBI module pages which can be found on:

特定のバージョン情報とドライバの正確な URL については、以下のアドレスにある DBI ドライバ一覧と DBI モジュールページをご覧下さい:

    http://dbi.perl.org/
    http://www.symbolstone.org/technology/perl/DBI

This list is automatically generated on a nightly basis from CPAN and should be up-to-date.

このリストは毎日、CPAN からの情報をベースに自動的に生成され、更新されます。

1.3. さらに詳しい情報はどこで手に入りますか?

There are a few information sources on DBI.

DBI についてはいくつかの情報源があります。

"Programming the Perl DBI"

(「入門 Perl DBI」)

"Programming the Perl DBI" is the official book on the DBI written by Alligator Descartes and Tim Bunce and published by O'Reilly & Associates. The book was released on February 9th, 2000.

"Programming the Perl DBI'' (和訳:「入門 Perl DBI」)は Alligator Descartes と Tim Bunce によって書かれ、O'Reilly & Associates から出版された DBI についての 公式な 本です。 この本は 2000年 2 月 9 日に出版されました。

The table of contents is:

目次は以下のようになっています:

    Preface
    1. Introduction
        From Mainframes to Workstations
        Perl
        DBI in the Real World
        A Historical Interlude and Standing Stones
    2. Basic Non-DBI Databases
        Storage Managers and Layers
        Query Languages and Data Functions
        Standing Stones and the Sample Database
        Flat-File Databases
        Putting Complex Data into Flat Files
        Concurrent Database Access and Locking
        DBM Files and the Berkeley Database Manager
        The MLDBM Module
        Summary
    3. SQL and Relational Databases
        The Relational Database Methodology
        Datatypes and NULL Values
        Querying Data
        Modifying Data Within Tables
        Creating and Destroying Tables
    4. Programming with the DBI
        DBI Architecture
        Handles
        Data Source Names
        Connection and Disconnection
        Error Handling
        Utility Methods and Functions
    5. Interacting with the Database
        Issuing Simple Queries
        Executing Non-SELECT Statements
        Binding Parameters to Statements
        Binding Output Columns
        do() Versus prepare()
        Atomic and Batch Fetching
    6. Advanced DBI
        Handle Attributes and Metadata
        Handling LONG/LOB Data
        Transactions, Locking, and Isolation
    7. ODBC and the DBI
        ODBC -- Embraced and Extended
        DBI -- Thrashed and Mutated
        The Nuts and Bolts of ODBC
        ODBC from Perl
        The Marriage of DBI and ODBC
        Questions and Choices
        Moving Between Win32::ODBC and the DBI
        And What About ADO?
    8. DBI Shell and Database Proxying
        dbish -- The DBI Shell
        Database Proxying
    A. DBI Specification
    B. Driver and Database Characteristics
    C. ASLaN Sacred Site Charter
    Index

The book should be available from all good bookshops and can be ordered online either <I>via</I> O'Reilly & Associates

この本はすべての大きな書店で手に入れることができます。 また 以下の サイトからオンラインで注文することができます。

    http://www.oreilly.com/catalog/perldbi

or Amazon

または Amazon から

    http://www.amazon.com/exec/obidos/ASIN/1565926994/dbi
POD documentation

(POD 文書)

PODs are chunks of documentation usually embedded within perl programs that document the code ``in place'', providing a useful resource for programmers and users of modules. POD for DBI and drivers is beginning to become more commonplace, and documentation for these modules can be read with the perldoc program included with Perl.

POD は文書の固まりで、いつもは Perl プログラムのコードの 「その場」に文書があり、埋め込まれています。 モジュールのプログラマやユーザに役に立つ資源を提供します。 DBI とドライバのための POD はごくありふれたものになってきています。 そしてこれらのモジュールの文書は Perl に入っている perldoc プログラムで 読むことが出来ます。

The DBI Specification

(DBI の仕様)

The POD for the DBI Specification can be read with the:

DBI 仕様の POD は以下のコマンドで読むことが出来ます:

    perldoc DBI

command. The Specification also forms Appendix A of "Programming the Perl DBI".

仕様は "Programming the Perl DBI" の付録 A にも載っています。

Oraperl

Users of the Oraperl emulation layer bundled with DBD::Oracle, may read up on how to program with the Oraperl interface by typing:

DBD::Oracle に同梱されている Oraperl エミュレーションレイヤのユーザは、 以下のようにタイプすることで Oraperl インターフェースでどのように プログラムするかを読むことが出来ます:

    perldoc Oraperl

This will produce an updated copy of the original oraperl man page written by Kevin Stock for perl4. The oraperl API is fully listed and described there.

これは Kevin Stock が書いた Perl4 のための元の oraperl man ページの 更新されたコピーを生成します。 oraperl API がすべて表示され、説明がされます。

Drivers

Users of the DBD modules may read about some of the private functions and quirks of that driver by typing:

DBD モジュールのユーザはプライベートな関数やそのドライバの癖を以下のように タイプすることで読むことが出来ます:

    perldoc <driver>

For example, the DBD::mSQL driver is bundled with driver-specific documentation that can be accessed by typing

例えば DBD::mSQL ドライバは、以下のようにタイプすると アクセスすることができるドライバ独自のドキュメントと一緒に提供されています。

    perldoc DBD::mSQL
Frequently Asked Questions

This document, the Frequently Asked Questions is also available as POD documentation! You can read this on your own system by typing:

このドキュメント、よくある質問 は POD ドキュメントとしても使えます! あなたのシステムで以下のようにタイプすると読むことが出来ます:

    perldoc DBI::FAQ

This may be more convenient to persons not permanently, or conveniently, connected to the Internet. The DBI::FAQ module should be downloaded and installed for the more up-to-date version.

これは常に、または簡単にインターネットに接続できない人にとってはより 便利かもしれません。 DBI::FAQ モジュールはより新しいバージョンのためにダウンロードされ インストールされなければなりません。

The version of DBI::FAQ shipped with the DBI module may be slightly out of date.

DBI モジュールと一緒に入る DBI::FAQ はちょっとだけ古いかもしれません。

POD in general

(一般的な POD)

Information on writing POD, and on the philosophy of POD in general, can be read by typing:

POD の書き方、POD 一般の原則は以下のようにタイプすることにより 読むことが出来ます:

    perldoc perlpod

Users with the Tk module installed may be interested to learn there is a Tk-based POD reader available called tkpod, which formats POD in a convenient and readable way. This is available via CPAN as the module called Tk::POD and is highly recommended.

Tk モジュールをインストールしているユーザは、tkpod という Tk を ベースとした POD リーダが使えることを聞いて興味をもつかもしれません。 これは簡単に読める形に POD を整形します。 Tk::POD と呼ばれるモジュールとしてCPANを 通じて 使うことが出来ます; これを強くお勧めします。

Driver and Database Characteristics

(ドライバとデータベースの特徴)

The driver summaries that were produced for Appendix B of "Programming the Perl DBI" are available online at:

"Programming the Perl DBI" の Appendix B のために作成されたドライバの要約が 以下のサイトからオンラインで利用できます:

    http://dbi.perl.org/
    http://www.symbolstone.org/technology/perl/DBI

in the driver information table. These summaries contain standardised information on each driver and database which should aid you in selecting a database to use. It will also inform you quickly of any issues within drivers or whether a driver is not fully compliant with the DBI Specification.

のドライバ情報テーブルにあります。 これらの要約には利用するデータベースを選ぶときに助けになるであろう、 各ドライバとデータベースについての標準化された情報が入っています。 ドライバでの論点やドライバが DBI 仕様と十分に互換性がないといったことを 簡単に知らせもします。

Rambles, Tidbits and Observations

(雑談、ちょっとしたニュース、評論)

    http://dbi.perl.org/tidbits
    http://www.symbolstone.org/technology/perl/DBI/tidbits

There are a series of occasional rambles from various people on the DBI 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.

簡単な点をはっきりさせようとしたり、最新のドキュメントの草案を完璧に 仕上げようとする DBI メーリングリストでのたくさんの人たちからの、その時々の 一連の雑談があります。 かなりのばらつきがありますが、インターフェースの作業に洞察力を与えています。

Articles

(記事)

A list of articles discussing the DBI can be found on the DBI WWW page at:

DBI について書かれた記事のリストが DBI WWW ページから見ることができます:

    http://dbi.perl.org/
    http://www.symbolstone.org/technology/perl/DBI

These articles are of varying quality and age, from the original Perl Journal article written by Alligator and Tim, to more recent debacles published online from about.com.

これらの記事は Alligator と Tim によって書かれた Perl Journal 記事から、 より最近の about.com からオンラインで流れた大失敗まで、年代も品質も バラつきがあります。

README files

(README ファイル)

The README 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 DBI WWW page at:

各ドライバに入っている README ファイルには、時々(じゃなかった、本当に!) 役に立つ情報が入っています。 これはユーザにはぴったりかもしれません。 それをお読みください。 これのおかげで、役に立たない我々の存在が少しはましにしてくれます。 これらはメインの DBI WWW ページからすべて読むことができます:

    http://dbi.perl.org/
    http://www.symbolstone.org/technology/perl/DBI
Mailing Lists

(メーリングリスト)

There are three mailing lists for DBI:

DBI のためのメーリングリストが三つあります。

    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)

For information on how to subscribe, set digest mode etc, and unsubscribe, send an email message (the content will be ignored) to:

購読、ダイジェストモードなどの設定、購読解除のための情報は、 次に E メールを送って下さい (本文は無視されます):

    dbi-announce-help@perl.org
    dbi-users-help@perl.org
    dbi-dev-help@perl.org
Mailing List Archives
US Mailing List Archives
    http://outside.organic.com/mail-archives/dbi-users/

Searchable hypermail archives of the three mailing lists, and some of the much older traffic have been set up for users to browse.

三つのメーリングリストの検索可能な hypermail アーカイブと かなり古いトラフィックでも閲覧できるようになっているものもあります。

European Mailing List Archives
    http://www.rosat.mpe-garching.mpg.de/mailing-lists/PerlDB-Interest

As per the US archive above.

上記の US archive と同じ。

コンパイルでの問題

2.1. コンパイルでの問題または「テストが失敗する!」

First off, consult the README 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 README files for each driver in advance online at:

まず最初に、そのドライバの README をみて、その問題に役に立つ情報がないか 調べてください。 あなたのアーキテクチャとオペレーティング・システムまたはデータベースでは 既知のバグかもしれません。 あらかじめオンラインにある README ファイルをチェックすることもできます:

    http://dbi.perl.org/
    http://www.symbolstone.org/technology/perl/DBI

If it's a known problem, you'll probably have to wait till it gets fixed. If you're really needing it fixed, try the following:

既知のバグであれば、たぶん修正されるまで待つべきでしょう。 もし本当にそれを修正する必要があるのであれば、以下のことに 挑戦してみてください。

Attempt to fix it yourself

(自分で修正してみる)

This technique is generally not 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:

この方法は気の弱い方には普通、お勧めしません。 本当に修正がうまくいったと思ったならば、パッチファイル(context diff)を 以下の説明と一緒に作者へ送ってください:

  • What the problem was, and test cases, if possible.

    何が問題だったか、そしてできればテストケース。

  • What you needed to do to fix it. Please make sure you mention everything.

    それを修正するために何が必要だったもの。 すべてを書いたか確認してください。

  • Platform information, database version, perl version, module version and DBI version.

    プラットホーム情報、データベースのバージョン、Perl のバージョン、 モジュールのバージョン、DBI のバージョン。

Email the author Do NOT whinge!

作者にEメールする 泣き言はやめて!

Please email the address listed in the WWW pages for whichever driver you are having problems with. Do not directly email the author at a known address unless it corresponds with the one listed.

障害があるドライバの WWW ページに記載されているアドレスに E メールしてください。 記載されているものに対応していなければ知っている作者のアドレス直接 E メールするのは やめてください

We tend to have real jobs to do, and we do read the mailing lists for problems. Besides, we may not have access to <insert your favourite brain-damaged platform here> and couldn't be of any assistance anyway! Apologies for sounding harsh, but that's the way of it!

我々はやらなければならない本来の仕事を持っていることが多く、障害のための メーリングリストをきちんと読んでいます。 それに <あなたのお気に入りのダメになっているプラットホーム名をここに 入れる> にはアクセスしたこともないかもしれませんし、なんの助けにも ならないかもしれません。 厳しく聞こえることは謝りますが、しかしそういうものなのです!

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 DBI circle is that we do appreciate the users' problems, since we work in similar environments.

しかし我々がボケっとしている夜中の 3 時に、あなたが創造の妖精を 捕まえることができるかもしれません。 そして 5 分以内にパッチをとることができるかもしれません。 我々は同じような環境で働いているので、DBI サークルではユーザの障害を正しく 認識しようとする雰囲気が あります

If you are planning to email the author, please furnish as much information as possible, ie:

作者に E メールしようとするならば、なるべく多くの情報を伝えてください。 つまり:

  • ALL the information asked for in the README file in the problematic module. And we mean ALL of it. We don't put lines like that in documentation for the good of our health, or to meet obscure README file standards of length.

    問題になっているモジュールのREADMEファイルで尋ねられている情報のすべて。 我々はその 全て を意図しています。 我々の健康のためとか、よくわからない README ファイルを標準の長さに 合わせるために、われわれはそのドキュメントにそれらの行を 入れてはいないのです。

  • If you have a core dump, try the Devel::CoreStack module for generating a stack trace from the core dump. Send us that too. Devel::CoreStack can be found on CPAN at:

    コアダンプがあれば、コアダンプからスタックトレースを生成するために Devel::Corestack モジュールを試してみてください。 これも送ってください。 Devel::CoreStack は CPAN の以下のところにあります:

        http://www.perl.com/cgi-bin/cpan_mod?module=Devel::CoreStack
  • Module versions, perl version, test cases, operating system versions and any other pertinent information.

    モジュールのバージョン、Perl のバージョン、テストケース、 オペレーティングシステムのバージョン、そして 関連するほかのすべての情報

Remember, the more information you send us, the quicker we can track problems down. If you send us no useful information, expect nothing back.

送る情報が多いほど、より早く問題を追いかけることができることを 忘れないでください。 役に立つ情報を送らなければ、何も返ってこないと思ってください。

Finally, please be aware that some authors, including Tim Bunce, specifically request that you do not mail them directly. Please respect their wishes and use the email addresses listed in the appropriate module README file.

最後に、Tim Bunce も含めて、作者によっては直接メール しない ように特に 要望している人もいることに注意してください。 彼らの要望を尊重し、対応するモジュールの README ファイルに載っている E メールアドレスを使ってください。

Email the dbi-users Mailing List

(dbi-users メーリング・リストにメールを送る)

It's usually a fairly intelligent idea to cc the mailing list anyway with problems. The authors all read the lists, so you lose nothing by mailing there.

何か問題があったらメーリングリストに cc することは通常、とても賢明な 考えです。 作者は全員このリストを読みます。 そのためそこへメールすることによって何も失うことはありません。

プラットフォームとドライバについて

3.1 ODBCとDBIは何が違うのですか?

In terms of architecture - not much: Both define programming interfaces. Both allow multiple drivers to be loaded to do the actual work.

アーキテクチャの面からいえばあまり大きな違いはありません。 両方ともプログラミングインターフェースを定義していますし、実際に機能のために 複数のドライバをロードすることを可能にしています。

In terms of ease of use - much: The DBI is a 'high level' interface that, like Perl itself, strives to make the simple things easy while still making the hard things possible. The ODBC is a 'low level' interface. All nuts-bolts-knobs-and-dials.

使いやすさの面からいえば大きく違います: DBI は Perl 自身のような「上位レベル」インターフェースです。 難しいことを可能としながら、単純なことを簡単にしようとしています。 ODBC は「下位レベル」インターフェースです。 全て(ナットにボルトにノブに文字盤といった=All nuts-bolts-knobs-and-dials) 基本的な部品です。

Now there's an ODBC driver for the DBI (DBD::ODBC) the "What's the difference" question is more usefully rephrased as:

いまや DBI のための ODBC ドライバ (DBD::ODBC) もあります。 「何が違うの?」という質問は次の質問としてより多く繰り返されています:

Chapter 7 of "Programming the Perl DBI" covers this topic in far more detail and should be consulted.

"Programming the Perl DBI'' の Chapter 7 は、この話題についてさらに詳細に カバーしていますのでご覧になってください。

3.2 Win32::ODBC と DBD::ODBC は何が違うのですか?

The DBI, and thus DBD::ODBC, has a different philosophy from the Win32::ODBC module:

DBI つまり DBD::ODBC は、Win32::ODBC とは違う原理を持っています。

The Win32::ODBC module is a 'thin' layer over the low-level ODBC API. The DBI defines a simpler 'higher level' interface.

Win32::ODBC モジュールは下位レベルの ODBC API をカバーする「薄い」層です。 DBI はより簡単で「より上位のレベル」のインタフェースを定義します。

The Win32::ODBC module gives you access to more of the ODBC API. The DBI and DBD::ODBC give you access to only the essentials. (But, unlike Win32::ODBC, the DBI and DBD::ODBC do support parameter binding and multiple prepared statements which reduces the load on the database server and can dramatically increase performance.)

Win32::ODBC モジュールはより多くの ODBC API へアクセスできるようにします。 DBI と DBD::ODBC は基本的なものだけにアクセスできるようにします。 (しかし Win32::ODBC とは違って DBI と DBD::ODBC は、データベースサーバの 負荷を減らし、劇的にパフォーマンスを向上させるパラメータの結びつけや 複数の準備(prepare)されたステートメントをサポートしています。)

The Win32::ODBC module only works on Win32 systems. The DBI and DBD::ODBC are very portable and work on Win32 and Unix.

Win32::ODBC モジュールは Win32 システムでしか動きません。 DBI と DBD::ODBC は非常に移植性が高く、Win32 でも Unix でも動きます。

The DBI and DBD::ODBC 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).

DBI と DBD::ODBC モジュールは Win32 のための Perl5.004 バイナリ ディストリビューションの標準部分として提供されます。 (古くて、標準ではない ActiveState 版では動きません) (訳者注: ActiveState でも DBI と一部の DBD が提供されています。 ただし古いバージョンのこともあります。)

Scripts written with the DBI and DBD::ODBC are faster than Win32::ODBC on Win32 and are trivially portable to other supported database types.

DBI と DBD::ODBC を使って書かれたスクリプトは Win32 上で Win32::ODBC よりも 速く動き、サポートされている他のデータベースタイプへ簡単に移行できます。

The DBI offers optional automatic printing or die()ing on errors which makes applications simpler and more robust.

DBI はオプションでエラー時の自動的出力や die() することを提供することで、 アプリケーションをより単純に、より堅牢にします。

The current DBD::ODBC driver version 0.16 is new and not yet fully stable. A new release is due soon [relative to the date of the next TPJ issue :-] and will be much improved and offer more ODBC functionality.

現在 DBD::ODBC ドライバはバージョン 0.16 は新しく、完全に安定は していません。 新しいリリースでは [次の TPJ が出版されるの日と比べて :-] すぐに 対応つもりです、そしてより進化し、より多くの ODBC 機能を提供します。

To summarise: The Win32::ODBC module is your best choice if you need access to more of the ODBC API than the DBI gives you. Otherwise, the DBI and DBD::ODBC combination may be your best bet.

まとめると: DBI が提供しているよりも多くの ODBC API にアクセスする必要が あれば、Win32::ODBC モジュールがベストな選択です。 そうでなければ DBI と DBD::ODBC の組み合わせが一番でしょう。

Chapter 7 of "Programming the Perl DBI" covers this topic in far more detail and should be consulted.

"Programming the Perl DBI" の Chapter 7 は、この話題についてさらに 詳細にカバーしていますのでご覧になってください。

3.3 DBI は Windows95/NT プラットホームでもサポートされていますか?

Finally, yes! Jeff Urlwin has been working diligently on building DBI and DBD::ODBC under these platforms, and, with the advent of a stabler perl and a port of MakeMaker, the project has come on by great leaps and bounds.

ついにそうなりました! Jeff Urlwin がこれらのフォーマットでの DBIDBD::ODBC の 構築のためにこつこつと働いてきました。 そしてより安定した Perl と Makemaker がついに出来ました。 プロジェクトは飛躍的に進行しています。

The DBI and DBD::Oracle Win32 ports are now a standard part of DBI, so, downloading DBI of version higher than 0.81 should work fine as should using the most recent DBD::Oracle version.

Win32 版の DBIDBD::Oracle は標準の DBI の一部となりました。 そのためバージョン 0.81 以降の DBI をダウンロードするとより新しい DBD::Oracle バージョンを使うことになります。

3.4 DBI で Microsoft Access やSQL-Server にアクセスできますか?

Yes, use the DBD::ODBC driver.

はい、DBD::ODBC ドライバを使って下さい。

3.5 Is there a DBD for <insert favourite database here>?

(3.5 <ここにあなたの好みのデータベースを入れる> というデータベースのためのDBDはありますか?)

First check if a driver is available on CPAN by searching for the name of the database (including common abbreviations and aliases).

データベースの名前 (およびよくある略称と別名) で検索することで、 ドライバが CPAN で利用可能かをまずチェックしてください。

Here's a general query that'll match all distributions:

以下は全ての配布にマッチングする一般的なクエリです:

    http://search.cpan.org/search?query=DBD&mode=dist

If you can't find a driver that way, you could check if the database supports ODBC drivers. If so then you could probably use the DBD::ODBC driver:

この方法でドライバを見つけられなかった場合、データベースが ODBC ドライバに 対応しているかをチェックしてください。 もしそうなら、おそらく DBD:: ODBC ドライバを使えます:

    http://search.cpan.org/dist/DBD-ODBC/

If not, then try asking on the dbi-users mailing list.

そうでなければ、dbi-users メーリングリストで質問してみてください。

3.6 DBMって何ですか?なぜその代わりにDBIを使わなければならないのですか?

Extracted from ``DBI - The Database Interface for Perl 5'':

"DBI - The Database Interface for Perl 5''からの抜粋:

    ``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.

        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.''
    「UNIXには簡単なファイルベースの「データベース」があります。
    名前を dbm システムといいます。
    dbmにより、データをファイルに格納したり、データを早く取り出したり
    することができます。
    しかし、それには重要な欠点も持っています。

        ファイルロック

        dbm システムは特に強力なファイルロックを許していませんし、
        [データベースへの]
        同時書き込みにより発生する問題を修正する能力もありません。

        任意のデータ構造

        dbm システムは一つのキーと値の組という決まったのデータ構造だけを
        許します。
        値は [C] の構造体のように、複雑なオブジェクトにもすることが
        できますが、キーはユニークでなければなりません。
        これは dbm システムの使い勝手には大きな制限です。

    しかし、dbm システムは、早く強力で非常によくテストされているので、
    簡単なデータセットと限られたリソースでユーザに便利な機能を
    提供しています。
    dbm システムにアクセスするための Perl モジュールは
    AnyDBM_File モジュールを通じて、
    コアPerl配布セットに統合されています。」

To sum up, DBM 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 via DBI.

要するに、DBM は基本的にリードオンリーのデータベース、または簡単な データセットを完全に満足させる解決法です。 しかし強力なトランザクション的なロックはいうまでもなく、より スケーラブルなデータセット操作のためには、ユーザに DBI通じて より 強力なデータベースエンジンを使うことをお勧めします。

Chapter 2 of "Programming the Perl DBI" discusses DBM files in detail.

"Programming the Perl DBI" の Chapter 2 は、DBM ファイルについて詳しく 述べています。

3.7 どのデータベースがお勧めですか?

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.

各データセット、計画される使用法そしてシステム構成が人によって違うので、 目指している答えが出しにくく特に難しい領域です。

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 mSQL 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 WWW site at:

現在の著者の視点からは、データセットが比較的小さく、テーブルが 100 万行よりも小さく、データベースのテーブル数が 1000 よりも少なければ、 mSQL は完璧に受け入れられるあなたの問題の解決法でしょう。 このデータベースは非常に安く、とても強力で、すぐれたサポートを持っています。 さらに詳しい情報が、以下の Hughes Technology WWW サイトにあります:

    http://www.hughes.com.au

You may also wish to look at MySQL which is a more powerful database engine that has a similar feel to mSQL.

より強力なデータベースエンジンで mSQL と同じような感じの MySQL を 見ることを望むかもしれません:

    http://www.tcx.se

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 Oracle RDBMS. Oracle's WWW site is an excellent source of more information.

データセットが 100 万行よりも大きいかテーブル数が 1000 より多ければ、 あるいはよりお金を持っているか、より大きなマシンを持っていれば、 Oracle RDBMS をお勧めします。 Oracle の WWW サイトはさらなる情報のすぐれた情報源です。

    http://www.oracle.com

Informix is another high-end RDBMS 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 WWW site at:

Informix は、考えるの価値があるもう一つのハイエンドな RDBMS です。 Oracle と Informix とはさまざまな違いがあり、あまりにも複雑なのでこの文書で 詳しく述べることはできません。 Informix の情報は以下の WWW サイトで見つかります:

    http://www.informix.com

In the case of WWW fronted applications, mSQL may be a better option due to slow connection times between a CGI script and the Oracle RDBMS and also the amount of resource each Oracle connection will consume. mSQL is lighter resource-wise and faster.

WWW フロントエンドアプリケーションの場合、CGI スクリプトと Oracle RDBMS との接続時間の遅さや、各 Oracle の接続が消費するリソースの 量から mSQL がよい選択かもしれません。 mSQL はより軽く、少ないリソースでより速く動きます。

These views are not necessarily representative of anyone else's opinions, and do not reflect any corporate sponsorship or views. They are provided as-is.

この意見は、他の人の意見を何も代表しませんし、いかなる企業の スポンサーシップや意見も反映していません。 まさに そのまま です。

3.8 Is <insert feature here> supported in DBI?

(3.8 <ここに機能を入れる> という機能は DBI でサポートされていますか?)

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 no.

あなたが要求している機能が標準でない、データベース特有の機能であれば、 答えは ノー でしょう。

DBI reflects a generic API that will work for most databases, and has no database-specific functionality.

DBI は、ほとんどのデータベースで動く 汎用的な API を反映しており、 データベース特有の機能は持っていません。

However, driver authors may, if they so desire, include hooks to database-specific functionality through the func() method defined in the DBI API. Script developers should note that use of functionality provided via the func() methods is very unlikely to be portable across databases.

しかし、ドライバの作者は、もし彼らがそう望むのであれば、DBI API の中で 定義されている func() メソッドを通じて、データベース特有の機能を 呼び出すための仕組みを入れることができます。 スクリプト開発者は func() メソッドを通じて提供される機能を使うことは、 データベースをまたがった移植ができないだろうということに注意して下さい。

プログラムについての質問

4.1 DBIはCGIプログラムに使えますか?

In a word, yes! DBI is hugely useful for CGI programming! In fact, I would tentatively say that CGI programming is one of two top uses for DBI.

一言で言えば、「イエス」です! DBI は CGI プログラムではとても便利です! 事実、CGI プログラムは DBI の主要な使い道の二つのうちの一つだともいえます。

DBI confers the ability to CGI programmers to power WWW-fronted databases to their users, which provides users with vast quantities of ordered data to play with. DBI 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 CGI scripts.

DBI は CGI プログラマにユーザへの WWW をフロントとしたデータベースのための 能力を与えます。 それはユーザがそれを使うことが出来るように手入れの行き届いた膨大な量の データを提供します。 もしサイトがデータベースサーバが対処可能な量よりも遙かに多くの トラフィックを受け取るならば、CGI スクリプトを何も変更することなく、 データベースサーバをアップグレードすることも、DBI は可能にします。

4.2 How do I get faster connection times with DBD::Oracle and CGI?

4.2 DBD::Oracle と CGI との接続はどのようにすれば速くなりますか?

    Contributed by John D. Groenveld

The Apache httpd maintains a pool of httpd children to service client requests.

Apache httpd はクライアント要求のサービスのために httpd の子供の プールを保持します。

Using the Apache mod_perl module by Doug MacEachern, the perl interpreter is embedded with the httpd children. The CGI, DBI, and your other favorite modules can be loaded at the startup of each child. These modules will not be reloaded unless changed on disk.

Doug MacEachern の Apache mod_perl モジュールを使うと、 perl インタープリタは httpd の子供に埋め込まれます。 CGI、DBI、その他の好きなモジュールを各子供が起動する時点で ロードすることができます。 これらのモジュールはディスク上で変更されない限り再ロードされません。

For more information on Apache, see the Apache Project's WWW site:

Apache についてのさらなる情報は、Apache Project の WWW サイトをご覧下さい:

    http://www.apache.org

The mod_perl module can be downloaded from CPAN via:

mod_perl モジュールは、CPAN の以下のアドレス から ダウンロードできます:

    http://www.perl.com/cgi-bin/cpan_mod?module=Apache

4.3 DBIとCGIを接続したままにするにはどうすればよいですか?

    Contributed by John D. Groenveld

Using Edmund Mergl's Apache::DBI module, database logins are stored in a hash with each of these httpd 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 httpd children.

Edmund Mergl の Apache::DBI モジュールを使うと、データベースへの ログインは httpd の子供それぞれのハッシュに格納されます。 もしあなたのアプリケーションが一つのデータベースユーザをベースにしていたら、 この接続は各子供によって開始されます。 現在、データベース接続は httpd の子供の間で共有することはできません。

Apache::DBI can be downloaded from CPAN via:

Apache::DBI はCPANの以下のアドレス から ダウンロードできます。

    http://www.perl.com/cgi-bin/cpan_mod?module=Apache::DBI

4.4 ``When I run a perl script from the command line, it works, but, when I run it under the httpd, it fails!'' Why?

(4.4 「コマンドラインでは動くのに、httpd からでは失敗します!」なぜ?)

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 DBD::Oracle, variables like ORACLE_HOME, ORACLE_SID or TWO_TASK.

基本的に、これはそれをコマンドラインから実行したときユーザは、 DBD::Oracle の場合であれば ORACLE_HOME, ORACLE_SID, TWO_TASK といった環境変数が正しく設定されていたために 発生するということがよくあります。

The httpd process usually runs under the user id of nobody, which implies there is no configured environment. Any scripts attempting to execute in this situation will correctly fail.

httpd プロセスは通常、何も環境変数が設定されていない nobody ユーザ ID の下で起動されます。 この状況のもとでスクリプトを実行しようとしても失敗するでしょう。

One way to solve this problem is to set the environment for your database in a BEGIN { } block at the top of your script. Another technique is to configure your WWW server to pass-through certain environment variables to your CGI scripts.

この問題を解決する方法の一つとして、あなたのスクリプトの最初で、 BEGIN{ } ブロックのなかでデータベースのための環境を 設定することがあります。 もう一つの方法としては、WWW サーバをあなたのCGIスクロプトにある 環境変数を渡すように設定することです。

Similarly, you should check your httpd error logfile for any clues, as well as the ``Idiot's Guide To Solving Perl / CGI Problems'' and ``Perl CGI Programming FAQ'' for further information. It is unlikely the problem is DBI-related.

同時に、手がかりを求めて httpd エラーログファイルや、より詳細な 情報のために「Idiot's Guide To Solving Perl / CGI Problems'」と 「Perl CGI Programming FAQ」もチェックするべきです。 これは DBI 関連の問題ではないようです。

The ``Idiot's Guide To Solving Perl / CGI Problems'' can be located at:

「Idiot's Guide To Solving Perl / CGI Problems'」は以下のアドレスにあります:

    http://www.perl.com/perl/faq/index.html

as can the ``Perl CGI Programming FAQ''. Read BOTH these documents carefully!

「Perl CGI Programming FAQ」もここにあります。 これらの文書を 両方とも 注意深く読んで下さい!

4.5 How do I get the number of rows returned from a SELECT statement?

(4.5 SELECT ステートメントから返される行の数はどのように取得できますか?)

Count them. Read the DBI docs for the rows() method.

数えて下さい。 DBIのドキュメントで rows() メソッドを読んで下さい。

その他の質問

5.1 DBIでマルチスレッドはできますか?

Perl version 5.005 and later can be built to support multi-threading. The DBI, as of version 1.02, does not yet support multi-threading so it would be unsafe to let more than one thread enter the DBI at the same time.

Perl version 5.005 以降では、マルチスレッドをサポートするように作られます。 DBI(version 1.02)はまだマルチスレッドをサポートしていません; このため、 同時に DBI に一つより多くのスレッドを DBI に入らせるのは安全ではありません。

It is expected that some future version of the DBI will at least be thread-safe (but not thread-hot) by automatically blocking threads intering the DBI while it's already in use.

将来のバージョンでは、既に使われている間は DBI を抑留するスレッドを 自動的にブロックすることにより、DBI はスレッドセーフ(しかし スレッドホットではない)になる予定です。

For some OCI example code for Oracle that has multi-threaded SELECT statements, see:

マルチスレッドの SELECT ステートメントを持っている Oracle のための OCI の 例のコードは以下のアドレスにあります:

    http://www.symbolstone.org/technology/oracle/oci/orathreads.tar.gz

5.2 DBIではBLOBデータをどのように扱えばよいのですか?

Handling BLOB data with the DBI is very straight-forward. BLOB columns are specified in a SELECT statement as per normal columns. However, you also need to specify a maximum BLOB size that the <I>database handle</I> can fetch using the LongReadLen attribute.

DBI で BLOB データを取り扱うことは、まさにそのままです。 BLOB カラムは SELECT ステートメントで通常のカラムと同じように指定されます。 しかしながら、LongReadLen 属性を使ってその データベースハンドル が取得することができる BLOB の最大の大きさを 指定する必要もあります。

For example:

例:

    ### $dbh is a connected database handle
    $sth = $dbh->prepare( "SELECT blob_column FROM blobby_table" );
    $sth->execute;

would fail.

これは失敗します。

    ### $dbh is a connected database handle
    ### Set the maximum BLOB size...
    $dbh->{LongReadLen} = 16384;        ### 16Kb...Not much of a BLOB!

    $sth = $dbh->prepare( "..." );

would succeed <I>provided no column values were larger than the specified value</I>.

指定された値よりも大きなカラム値がないのであれば、これは成功します。

If the BLOB data is longer than the value of LongReadLen, then an error will occur. However, the DBI provides an additional piece of functionality that will automatically truncate the fetched BLOB to the size of LongReadLen if it is longer. This does not cause an error to occur, but may make your fetched BLOB data useless.

もし BLOB データが LongReadLen の値よりも長ければ、エラーが発生します。 しかしながら、もし長ければ取り出された BLOB を LongReadLen の大きさに 自動的に切り捨てるという追加の機能を DBI は提供しています。 これはエラーを発生を押さえますが、しかし取り出された BLOB データを 使い物にならなくするかもしれません。

This behaviour is regulated by the LongTruncOk attribute which is defaultly set to a false value ( thus making overlong BLOB fetches fail ).

この動きは LongTruncOk 属性によって制御されており、デフォルトでは 偽に設定されます (このため長すぎる BLOB の取り出しは失敗します)。

    ### Set BLOB handling such that it's 16Kb and can be truncated
    $dbh->{LongReadLen} = 16384;
    $dbh->{LongTruncOk} = 1;

Truncation of BLOB data may not be a big deal in cases where the BLOB contains run-length encoded data, but data containing checksums at the end, for example, a ZIP file, would be rendered useless.

BLOB データの切り捨ては、BLOB にランレングス符号化方式のデータが 入っている場合には大した問題にはならないかもしれませんが、 ZIP ファイルのように、データの最後にチェックサムが入っているデータは 使い物にならなくなるでしょう。

5.2 DBIでストアド・プロシージャを呼び出すのはどのようにすればよいですか?

The DBI does not define a database-independent way of calling stored procedures.

DBI はデータベースに依存しないストアド・プロシージャの呼び出し方法を 定義していません。

However, most database that support them also provide a way to call them from SQL statements - and the DBI certainly supports that.

しかし、ほとんどのデータベースがそれらをサポートし、SQL ステートメントから 呼び出す方法を提供しています - そして DBI はそれをしっかりと サポートしています。

So, assuming that you have created a stored procedure within the target database, eg, an Oracle database, you can use $dbh->do() to immediately execute the procedure. For example,

そこで目標のデータベース、例えば Oracle データベースなどで ストアド・プロシージャが作ってあるとすると、$dbh->do() を使って そのプロシージャをすぐに実行することができます。 以下に例をあげます:

    $dbh->do( "BEGIN someProcedure; END;" );   # Oracle-specific

You should also be able to prepare and execute, which is the recommended way if you'll be calling the procedure often.

prepareexecute を使うこともできます; これは何度もプロシージャを 呼び出すときにはお勧めです。

5.4 DBI でストアドプロシージャからの戻り値を取得するにはどのようにすればよいですか?

    Contributed by Jeff Urlwin

    $sth = $dbh->prepare( "BEGIN foo(:1, :2, :3); END;" );
    $sth->bind_param(1, $a);
    $sth->bind_param_inout(2, \$path, 2000);
    $sth->bind_param_inout(3, \$success, 2000);
    $sth->execute;

Remember to perform error checking, though! ( Or use the RaiseError attribute ).

エラーチェックもお忘れなく!(もしくは RaiseError 属性を使って下さい)

5.5 DBIでデータベースの作成、削除はどのようにすればよいですか?

Database creation and deletion are concepts that are entirely too abstract to be adequately supported by DBI. For example, Oracle does not support the concept of dropping a database at all! Also, in Oracle, the database server essentially is 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.

データベースの作成、削除はあまりにも抽象的な概念なので、DBI では適切に サポートできません。 例えば、Oracle はデータベースを削除するという考えを全く サポートしていません。 同様に Oracle では、データベース サーバ が基本的にデータベースで あり、mSQL ではサーバ・プロセスはなんの問題もなく、そこで作られた データベースなしに動きます。 この問題はあまりにも異なるために、それなりに価値がある方法では 攻略できません。

Some drivers, therefore, support database creation and deletion through the private func() methods. You should check the documentation for the drivers you are using to see if they support this mechanism.

このため、いくつかのドライバはデータベースの作成、削除はプライベートな func() メソッドを通じて提供しています。 この機能をサポートしているかについては、使っているドライバのドキュメントを チェックして下さい。

5.6 DBIはcommitまたはrollbackステートメントはどのようにすることができますか?

See the commit() and rollback() methods in the DBI Specification.

DBI の仕様の commit(), rollback() メソッドをご覧下さい。

Chapter 6 of "Programming the Perl DBI" discusses transaction handling within the context of DBI in more detail.

"Programming the Perl DBI'' の Chapter 6 は、DBI のコンテキストでの トランザクション操作についてより詳しく述べています。

5.7 DBIではNULL値はどのように扱われますか?

NULL values in DBI are specified to be treated as the value undef. NULLs can be inserted into databases as NULL, for example:

DBI では、NULL 値は undef として扱われるような仕様になっています。 NULL はデータベースに NULL として挿入できます; 例えば以下のようにできます:

    $rv = $dbh->do( "INSERT INTO table VALUES( NULL )" );

but when queried back, the NULLs should be tested against undef. This is standard across all drivers.

しかし問い合わせの戻りでは、NULLundef かどうかで調べます。 これは全てのドライバでの標準です。

5.8 funcメソッドはいったい何をするのですか?

The func() method is defined within DBI as being an entry point for database-specific functionality, eg, the ability to create or drop databases. Invoking these driver-specific methods is simple, for example, to invoke a createDatabase method that has one argument, we would write:

func()メソッドは、データベース特有の機能へのエントリ・ポイントとしてDBIの中で定義されています。 例えばデータベースの作成、削除といったことです。 これらのデータベース特有のメソッドの呼び出しは簡単です。 たとえば一つの引数をもつcreateDatabaseメソッドの呼び出しは以下のように書けます:

    $rv =$dbh->func( 'argument', 'createDatabase' );

Software developers should note that the func() methods are non-portable between databases.

ソフトウェア開発者は func() メソッドがデータベース間で 移植性がないことに注意して下さい。

5.9 DBIは2000年以降も大丈夫ですか?

DBI has no knowledge of understanding of what dates are. Therefore, DBI 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.

DBI は日付が何であるかを理解する知識を持っていません。 このため DBI 自身は 2000 年問題を抱えていません。 それぞれのドライバが内部では日付を取り扱うコードを 使っているかもしれませんし、このため潜在的には 2000 年問題の疑いは ありますが、しかしこれはありそうもないことです。

You may also wish to read the ``Does Perl have a Year 2000 problem?'' section of the Perl FAQ at:

以下のアドレスにある Perl FAQ の "Does Perl have a Year 2000 problem?" (= Perl には 2000 年問題があるのですか?)も読みたいかもしれません:

    http://www.perl.com/CPAN/doc/FAQs/FAQ/PerlFAQ.html

サポートとトレーニング

The Perl5 Database Interface is FREE software. IT COMES WITHOUT WARRANTY OF ANY KIND. See the DBI README for more details.

Perl5データベースインターフェースは フリー ソフトウェアです。 いかなる保証もしません。 詳細は DBI README をご覧下さい。

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. Caveat emptor.

しかしながら、いくつかの組織が DBI について技術サポートや トレーニング・プログラムを提供しています。 現在作者はこれらのサービスの質がどれくらいのものかを知りません。 ここに入っているリンクは参考のためのものであり、なんら 推奨するものではありません。 自己責任で

商用サポート

The Perl Clinic

The Perl Clinic provides commercial support for Perl and Perl related problems, including the DBI and its drivers. Support is provided by the company with whom Tim Bunce, author of DBI and DBD::Oracle, works and ActiveState. For more information on their services, please see:

The Perl Clinic は PerlDBI やそのドライバを含む Perl に関連する 問題のサポートを商用で提供しています。 サポートは DBIDBD::Oracle の作者である Tim Bunce や ActiveStateと一緒になって提供されています。 サービスについての詳しい情報は以下のURLをご覧下さい:

    http://www.perlclinic.com

トレーニング

Westlake Solutions

A hands-on class for experienced Perl CGI developers that teaches how to write database-connected CGI scripts using Perl and DBI.pm. This course, along with four other courses on CGI scripting with Perl, is taught in Washington, DC; Arlington, Virginia; and on-site worldwide upon request.

Perl CGI 開発経験者のためのハンズ−オンクラスで、Perl と DBI.pm を使った データベースに接続する CGI スクリプトの書き方を教えます。 このコースは、Perl による CGI スクリプトについての他の四つのコースとともに、 Washington, DC; Virginia州Arlington、そして要求に合わせて世界中の オン・サイトで開かれています。

See:

詳細については:

    http://www.westlake.com/training

for more details.

を参照してください。

その他のリファンレス

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.

このセクションでは、DBI ユーザに興味深そうなその他の WWW リンクを提供します。 これらは確認されておらず、サイトが見つからなかったり、ドキュメントが 見あたらなかったりするかもしれません。

    http://www-ccs.cs.umass.edu/db.html
    http://www.odmg.org/odmg93/updates_dbarry.html
    http://www.jcc.com/sql_stnd.html

作者

Alligator Descartes <http://www.symbolstone.org/descarte/contact.html>. Portions are Copyright their original stated authors.

コピーライト

This document is Copyright (c)1994-2000 Alligator Descartes, with portions Copyright (c)1994-2000 their original authors. This module is released under the 'Artistic' license which you can find in the perl distribution.

This document is Copyright (c)1997-2000 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 AUTHOR and COPYRIGHT 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 <http://www.symbolstone.org/descarte/contact.html>.