Rating: - very mediocre
This book is very much a regurgitation of the docs you can find online. They are incomplete, and so is this book. I've been coding db's for 15+ years, so I can spot a mediocre doc when I see one almost instantly. I bought this book to learn more about the connection attributes - I have found evidence there are more than 2, but all the book discusses are PrintError and RaiseError. Big whoop... I have found several bugs in the DBI regarding binding params for parameterized sql statements, and am also having a problem w/ Perl trimming right spaces on my char columns, which caused major headaches and a lot of lost time debugging. The book doesn't help w/ any of this - I can't find any info that will help me solve any of these problems, although I remain convinced there must be some connection attibute to tell Perl to trim right padded spaces, etc. (LongTrunc?).
The bottom line is this: the book is very much the same as the on-line docs, and then they added in the obligitory but never necessary SQL intro chapters, nonsense on a "flat file db", etc. They pumped up the material to make it big enough to be a book. There's more than a little something missing - I totally agree w/ Mr. Philip R. Heath (thank you for an honest, accurate review).
Rating: - What's There Is Good, But We Need More
This is a good DBI reference for experienced perl programmers. The authors give you a good road map in the introduction so that you can find what you need to accomplish your task.
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.
Rating: - Valuable reference for Perl programmer
Contrary to what some people have written about this book it does contain plenty of example code and it does contain working code. They do an excellent job of telling you what results from method calls and give example code using those methods. Having some knowledge about Perl does help when reading the book. They tell you what the DBI is, how it works, why it is useful, and then go on to show you how to make it a very useful tool. They clearly explain how to deal with retrieved data and give many examples of retrieving data and working with the retrieved data. They explain how to use the power of the DBI to make db connections easier and faster as your programs grow. Once you understand what statement handles are and how they are used, what database handles are and how they are used(which are both clearly explained in the book), you can use the Appendix A as a quick reference for the method calls you might forget. Appendix B is a bit dated but gives detail about many database drivers you can use with the DBI. If you want something that has a better flow than the man pages this book is what you want.
Rating: - Not very accessible as an introduction or a reference.
This book did not serve me well as an introduction or as a reference. I also did not feel that it had enough detail or "under the hood" information to fit in with the "Programming..." series of O'Reilly books, nor the organization of such. I still give it two stars, instead of one, only because I do occaisionally open up the book and "fish" for an example or solution to a particular problem. It's about as successful as fishing without bait, in most cases.
Rating: - Made me scream
This book is very high on theory and light on tutorials. I bought the book because I need to interface perl programs with my MySQL database (One that the book doesn't cover explicitly). On P79 they finally get around to telling you how to call the DBI. Then they talk extensively about handles and error handling (Before you can even write anything which could have errors!). It is P86 before they tell you how to establish a connection to the database (Not ask it anything, that doesn't come for another 20 pages, just connect). You need to know the data source to do so, they recomend the DBI->data_sources() method; unfortunatly they do not tell you what that method is, or how to implement it. (You ready to scream yet?) They include a small program to look up the information, but when I typed it in, it only gave me cryptic errors (Undefined variable in concatination - there was no concatination, or any "." in the whole program, and the line number was that of a simple 'print "\n";' statement). I am only 1/2 way through the book so far, I am hoping it gets a bit more practical in the following chapters, but am not optimistic.
The authors seem to be very knowledgeable in their subject. They should have talked to someone who doesn't know anything about DBI (Preferably someone who is short on time and long on stuff that needs to be run) when they determined the content and layout of this book.
|