Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??


  • (DBD::Oracle)


  • DBI and Oraperl emulation using DBD::Oracle by <cite><></cite>
  • Original Oraperl 2.4 code and documentation by <cite>Kevin Stock <></cite>.

This is a short review of the two most used Perl toolkits for retrieving data from an Oracle database, DBI and Oraperl.

In the beginning, there was Oraperl, and if you were using Perl 4, Oraperl was the only game in town. Then came Perl 5, then DBI. Now every RDBMS worth using has a uniform interface for Perl.

But...what to do with all that old Oraperl code? Re-write?, /dev/null?, keep it? *can* keep it!

The Oraperl module (originally written by Kevin Stock) was re-written for Perl 5 by Tim Bunce to use the DBD::Oracle interface. So you get the best of both worlds...backward compatability for your existing scripts, and a new API to utilize in case you desire a generic interface that could perhaps work against another DBI supported RDBMS.

On the job, I use both. I support a web-based HR system that was written originally in Perl 4 using Oraperl. This codebase now is on Perl 5, however the scripts still utilize Oraperl. So for new development I use DBD::Oracle via DBI, and when maintaining existing scripts I keep using Oraperl.

When first taking over this position, I was convinced that I would need to eventually remove all that damn Oraperl....then I read the perldoc, and realized that this was not the same Oraperl I used about 4 years previous in another life, but one written and supported by the very man who wrote and supported DBI and DBD::Oracle...Tim Bunce.

So instead of spending time re-writing boatloads of working code, I spent some time using Benchmark and attempted to see if there was any significant performance differences in using DBD:Oracle directly, or using the Oraperl interface to it. My benchmarks all proved out to me that Oraperl was in fact slower....just barely. In fact, they were so close in my tests that I just have no valid performance reasons to rework any Oraperl into native DBI.

So which to use for accessing your Oracle database? Since Tim mentions in the docs that Oraperl is for backward compatibility, I suggest that you do not <cite>use Oraperl;</cite> if you are starting fresh. If you have existing code and are curious to the benefits of porting the code to native DBI...that's your call, I found no performance reasons for doing so, and since the same man that supports DBI wrote Oraperl, there shouldn't be any pressing issues over support.

Bottom line is that both these modules are of high quality and production-ready, you can be safe utilizing either.

For this review, I have decided to not supply any code samples as Tim Bunce has provided plenty of them in the perldocs. So if you are curious about syntactical and/or other differences....please refer to these links:

In reply to DBI vs. Oraperl by wardk

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2023-06-01 02:56 GMT
Find Nodes?
    Voting Booth?

    No recent polls found