Wow, that is some pretty funky code, did you copy it out of a book?

A couple of things spring to mind immediately: in the sub pointed to by _connectOracle, you initiate a new database connection each time you call it, until the passed handle goes out of scope, at which point it will be forcibly destructed, instead of being gracefully torn down with the disconnect method. I would rearrange that as:

{ my $dbh; END { defined $dbh and $dbh->disconnect } sub get_dbh { return $dbh if defined $dbh; # ... connect to Oracle once only $dbh = DBI->connect( ... ); return $dbh; } }
In the executeQuery routine you are fetching the passed parameters into variable, except that you are ignoring the first parameter! Array indices start from zero, so the first parameter passed to the routine is $_[0]. Were you aware of this?


In reply to Re:x3 Buffer Problem in dbi module ? by grinder
in thread Buffer Problem in dbi module ? by subbu

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.