RE: How to read CLOB return value of Stored Function in Perl



Prakash Inuganti -X (pinugant - Digital-X, Inc. at Cisco) wrote:

[snip]
my $sth = $self->{_dbh}->prepare(q{
BEGIN
:pid_str := f_load(:p1, :p2);
END; });


There's no need to use PL/SQL procedural style here. Just SELECT the
function, and Oracle will handle the CLOB part for you.

local $dbh->{LongReadLen} = 2048000; # biggest blob

my $sth = $dbh->prepare("select f_load(?,?) from dual")
|| die $dbh->errstr;
$sth->execute($id,$type)
|| die $sth->errstr;
my ($pid_str) = $sth->fetchrow;

Hth,
Philip
.



Relevant Pages