Subject: | DBD INVALID_HANDLE: OCILobGetLength |
The following script fails with:
DBD::Oracle::db ora_lob_length failed: (DBD INVALID_HANDLE:
OCILobGetLength) at empty_lob.pl line 26.
Since as far as I am aware, there is no way in DBD::Oracle to detect a
NULL lob via the API I wonder how can you deal with NULL lobs?
use strict;
use warnings;
use DBI;
use DBD::Oracle qw(:ora_types);
use Data::Dumper;
my $h = DBI->connect;
$h->do(<<'EOT');
create procedure p_mje(plob OUT NOCOPY clob) AS
BEGIN
plob := NULL;
END;
EOT
my $s = $h->prepare(<<'EOT', {ora_auto_lob => 0, ora_check_sql => 0});
begin p_mje(?); end;
EOT
my $lob;
$s->bind_param_inout(1, \$lob, 20, {ora_type => ORA_CLOB});
$s->execute;
print Dumper([$lob]);
my $len = $h->ora_lob_length($lob);
END {
$h->do(q{drop procedure p_mje});
}
Martin
--
Martin J. Evans
Wetherby, UK