Problem inserting CLOB via stored procedure



I'm having trouble inserting data using an Oracle stored procedure.

I'm using this method in my database class:

sub CreateCurvePointsText {
my $self = shift;
my ($curve_id, $values) = @_;
my $val_length = length $values;
if ($val_length > $MAX_CLOB_LEN) {
print STDERR "ERROR: Data values exceeded 32KB in
CreateCurvePointsText\n";
return 0;
} else {
my $out;
my $sql = <<" SQLEND";
BEGIN
$PKGNAME.CreateCurvePointsText(:id, :values, :out);
END;
SQLEND

my $sth = $self->dbh->prepare($sql);
print "Prepared statement \n".$sth->{'Statement'}."\n";
$sth->bind_param(':id', $curve_id);
$sth->bind_param(':values', $values, { ora_type => ORA_CLOB }
);
$sth->bind_param_inout(':out', \$out, 1);
my $ok = $sth->execute;
if ($ok) {
#print "Successfully executed statement\n";
return $out;
} else {
warn "Error code: ".$self->dbh->err."\nError message:
".$self->dbh->errstr."\n";
return undef;
}
}
}

When I call this method with a number in $curve_id and a string in
$values, it prints out this error:

Error code: 6550
Error message: ORA-06550: line 2, column 17:
PLS-00306: wrong number or types of arguments in call to
'CREATECURVEPOINTSTEXT'
ORA-06550: line 2, column 17:
PL/SQL: Statement ignored (DBD: oexec error)

I'm sure the number of arguments to the proc is correct, so it must be
the types of the arguments. I suspect it's the CLOB, but I don't know
how to check.

Where am I passing the wrong types of arguments?

Thanks!

Mike

.