Posts Categorized: DBD::Oracle
If you have ever had this message: Unable to locate an oracle.mk, proc.mk or other suitable *.mk file in your Oracle installation. (I looked in…) It can be a very frustrating one to track down. There is no 100% answer for this problem but there seems to be two main scenarios where I have encountered this and have come up with somewhat of a solution, here it is.
I have successfully compiled and installed DBD::Oracle on Windows 2008 Server 64bit operating system today. I used the latest version of DBD::Oracle 1.24, version 188.8.131.52.0 for 64bit Windows of Oracle’s Instant Client Package – Basic along with the Instant Client Package – SQL*Plus and finally the Instant Client Package – SDK. Here are some instructions that will help with the install.
The “Beer” version of DBD::Oracle (1.24) has been released. You can find it at CPAN DBD::Oracle. DBD::Oracle is a Perl module that works with the DBI module to provide access to Oracle databases. It is maintained by me, John Scoles, under the auspices of Pythian as Open Source/Free Software. This is largely a maintenance release that fixes a number of bugs. New stuff includes some more improvements to embedded types from Charles Jardine. Find out more here.
I installed DBD::Oracle on an IBM AIX 5.1 box, and for once I have some good news. Anyone who has ever tried this will know of some of the troubles I speak of. When dealing with DBI and any DBD on a AIX box, you either must either be lucky enough to have the same compiler installed that built the version of Perl that comes with the box (I have never seen this happen); or you have to spend a great deal of time downloading and installing your own GCC and the building your own version of Perl. Fortunately, all the hard work was done for me by other members of my team. Here’s how to do it.
Thanks to a patch from Tomas Pokorny, you can now select Oracle user-defined types directly into a Perl object. User-defined types include Object, Varray, and Table. These have been around in Oracle since 8i but have never really gained any sort of popularity for any number or reasons. With the new functionality of DBD::Oracle, selects of these objects are simple to work with in Perl. Lets take the example below for a web site that has a number of different “user” types. Lets have a look.
DBD::Oracle (1.23) has been released. DBD::Oracle is the Perl module that works with the DBI module to provide access to Oracle databases. It is maintained by me, John Scoles, under the auspices of The Pythian Group as open source/free software. This release is largely a maintenance release that fixes a number of bugs. New stuff includes the ability to fetch Oracle embedded types directly into an oracle object; a big thank you goes out to Tomas Pokorny for that patch.
The latest release of DBD::Oracle is now ready and can be found at: CPAN DBD::Oracle. It is a Perl module that works with the DBI module to provide access to Oracle databases. It is maintained by me, John Scoles, under the auspices of The Pythian Group as open source/free software.
With some of the new functionality that was introduced in DBD::Oracle 1.21, you can no longer use the Oracle 7 and most early 8 clients to build DBD::Oracle. I hope this little table will help you choose which version of DBD::Oracle is right for you. As there are dozens and dozens of different versions of Oracle’s clients, I did not bother to list any of them, just the major release versions of Oracle that are out there.
There seems to be a bug in DBD::Oracle’s execute_array when working with 11g. If you tell DBD::Oracle to autocommit, it seems that in 11g this commit will not take place when an error occurs during the processing of one of the tuples that you passed into execute_array. I included the tables, code and workaround in this post.
This paper goes over what needs to be done to use OCI effectively, especially in a web environment. The step-by-step approach taken in this document is very readable and the well explained code snippets make it a very good reference — great for comparing your code to the “proper” way to do it.