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
|