Programming the Perl DBI: Database programming with Perl 1st Edition
Use the Amazon App to scan ISBNs and compare prices.
One of the greatest strengths of the Perl programming language is its ability to manipulate large amounts of data. Database programming is therefore a natural fit for Perl, not only for business applications but also for CGI-based web and intranet applications.The primary interface for database programming in Perl is DBI. DBI is a database-independent package that provides a consistent set of routines regardless of what database product you use--Oracle, Sybase, Ingres, Informix, you name it. The design of DBI is to separate the actual database drivers (DBDs) from the programmer's API, so any DBI program can work with any database, or even with multiple databases by different vendors simultaneously.Programming the Perl DBI is coauthored by Alligator Descartes, one of the most active members of the DBI community, and by Tim Bunce, the inventor of DBI. For the uninitiated, the book explains the architecture of DBI and shows you how to write DBI-based programs. For the experienced DBI dabbler, this book reveals DBI's nuances and the peculiarities of each individual DBD.The book includes:
- An introduction to DBI and its design
- How to construct queries and bind parameters
- Working with database, driver, and statement handles
- Debugging techniques
- Coverage of each existing DBD
- A complete reference to DBI
Frequently bought together

- +
- +
Customers who bought this item also bought
Editorial Reviews
Amazon.com Review
Far from being a formalized how-to or man page, Programming Perl's DBI is a mini textbook in database programming, ideal for CPAN-savvy Perl programmers with little or no experience in database programming. Descartes and Bunce develop primitive notions of databases by using flat files, and they introduce relational databases with careful didactic motivation. The example database used throughout the book contains ancient sacred monolithic sites in the UK and elsewhere, of which Stonehenge is the most famous. Readers will learn about these primitive places while storing, updating, deleting, sorting, and locking their descriptors using flat files, nonrelational and relational databases, and a tutorial on SQL. The last chapters describe the peculiarities of interacting with ODBC and introduce DBI's Perl-less diagnostic shell and database proxying.
The authors use many modules--including DBI itself--that are not part of the vanilla Perl distribution, and Descartes and Bunce introduce them without explaining where to find or build them. Perl newbies with no CPAN experience may find themselves derailed early. The Storage module seems not to be available on CPAN at all (at the time of this writing). Fortunately, DBI and friends build, test, and install seamlessly under Linux/Red Hat 6.1.
At 350 pages, Programming the Perl DBI is 60 percent text--filled with highly annotated Perl code--and 40 percent appendices covering a detailed specification of DBI and 3-to-5-page descriptions of each of the 14 supported databases. Brevity is a large component of this book's wit. Clarity is the rest of it. --Peter Leopold
About the Author
Tim Bunce has been a perl5 porter since 1994, contributing to the development of the Perl language and many of its core modules. He is the author and maintainer of the DBI, DBD::Oracle,and Oracle::OCI modules, and author and co-maintainer of The Perl Module List. Tim is the founder and CTO of Data-Plan Services, a perl, database, and performance consultancy with an international client base. Prior to that we was Technical Director (CTO) of IG in the UK where he was awarded by British Telecom for his role in the rapid development of their Call Management Information service, a system implemented in Perl. He is co-author, along with Alligator Descartes, of Programming the Perl DBI, the definitive book on DBI, published by O'Reilly & Associates in February 2000.
Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Product details
- ASIN : 1565926994
- Publisher : O'Reilly Media; 1st edition (February 29, 2000)
- Language : English
- Paperback : 366 pages
- ISBN-10 : 9781565926998
- ISBN-13 : 978-1565926998
- Item Weight : 1.27 pounds
- Dimensions : 7 x 0.86 x 9.19 inches
- Best Sellers Rank: #368,040 in Books (See Top 100 in Books)
- #9 in Relational Databases
- #18 in Perl Programming
- #99 in Object-Oriented Software Design
- Customer Reviews:
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonTop reviews from the United States
There was a problem filtering reviews right now. Please try again later.
The Cheetah Book has a lot of useful information in it. Obviously, it describes the core DBI functionality very clearly, but it also contains a lot of information that was not previously available in a form comparable to what is in the book. For example, the extensive Appendix B, which lists a lot of details about each of the various drivers, is very useful and informative indeed. The information is not yet available elsewhere in this format, and you'd have to download all the drivers to be able to get all the information in one place. The guide to using the DBI Proxy Server is invaluable. The non-DBI database information in Chapter 2 is interesting; it shows how diverse the Perl modules are. And the comparison with Win32::ODBC is illuminating.
There is information in the main text which has not been documented before, such as the "use DBI qw(:sql_types);" -- that isn't in Appendix A (the DBI Specification), either, but that oversight will no doubt be fixed so that it is in 'perldoc DBI' by the time DBI 1.14 is available on CPAN.
This book does not attempt to teach you the rudiments of Perl, and nor should it. It does not teach everything about SQL, and nor should it. It doesn't teach you about every possible use of DBI, and it shouldn't try to do that either. It is a pity that the use of DBI with the Apache web server and mod_perl is not covered at all, but even that would be difficult to do sensibly. Half the effort would be in explaining how to handle HTML and CGI and not in using DBI per se. Nevertheless, should there be a second edition, this is something that should be covered in outline, even if not in complete detail.
If you have any intention of working with DBI, either as a regular user or as a driver writer, you need this book. It is clear and pleasant to read. Having the DBI specification printed in book format is worth the price of the book alone; the rest of the material is also very valuable.
Go, Buy!
Anyone who works with data of any kind will find much food for thought here. Great job, Tim and Alligator.
I needed to interface to an existing database so I skipped chapter 2 on alternative persistent storage mechanisms.
Having prior experience with SQL, I also skipped chapter 3.
Chapters 4-6 are where the majority of people are going to find useful information. There you will find good explanations on connecting to databases, executing SQL statements, and some advanced features such as binding variables. The authors give a good treatment of the various ways to execute queries with performance tradeoffs.
Chapter 7 is only useful if you are working on a Windows platform. My database is on Solaris so this wasn't something that I needed.
As I said, though, what's there is good, but I there is definitely something missing. I needed to be able to call Oracle stored procedures as well as executing simple SQL queries. It would be nice to include some examples of calling stored procedures using the major vendors: Oracle, Informix, Sybase, etc. This information is hard to come by on the web. There are subtleties in using inout parameters in stored procedure calls that require some extra work in perl. You have to size variables large enough to store the largest value that is in the database. Since perl handles all string sizes dynamically, I used sprintf to force the strings to be large enough before calling the stored procedure. I don't know if you would run into these issues with outher databases, but it would be good to have this information with the rest of this text. That would make this fine book complete.









