When you run into errors or unexpected results in DBI related scripts, why not have DBI help you to show it?

my $db_server = ""; my $host = $db_server; my $db = ""; my $db_user = ""; my $db_password = ''; my $dbh = DBI->connect("dbi:Oracle:$host", $db_user, # Do NOT quote a simple variable (yes, undef is vali +d) $db_password, # Do NOT quote a simple variable (yes, undef is vali +d) { RaiseError => 1, # Let DBI crash on errors PrintError => 1, # And have it shaw what fails ChopBlanks => 1, # Mostly a good idea ShowErrorStatement => 1, # You'll want to see the statement FetchHashKeyName => "NAME_lc", # Be predictable for field n +ames LongReadLen => 0x7FFFF, # How big is your data? } ) or die "Couldn't connect to database: ".DBI->errstr;

When that still doesn't help, you want to peek at DBI's trace.

As you are a poor user that connects to Oracle (we all know that Oracle sucks beyond belief in many ways, but to be honest, so do most - if not all - other databases as well), you will probably also have to check out the LongReadLen (you already do, but I don't know how well length returns the correct size(s)) and LongTrunkOk attributes. For Oracle they do matter (a lot).

Last but not least, check out bind_param (something like  $sth->bind_param (1, $in_blob, { ora_type => SQLT_BIN });) and how Oracle deals with it.


Enjoy, Have FUN! H.Merijn

In reply to Re: displaying BLOB from Oracle : help by Tux
in thread displaying BLOB from Oracle : help by sdj

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.