Inserting large values through Perl
I am trying to call an Oracle stored procedure which takes in a number of input parameters. I found that if a parameter size is more than 32000 (around 32K) then I receive the following error when calling my stored procedure:
DBD::Oracle::st execute failed: ORA-01460: unimplemented or unreasonable conversion requested (DBD ERROR: OCIStmtExecute) at ./job_setup.pl line 109.
The following is my Perl code that calls the stored procedure:
eval
{
my $sp = $dbh->prepare(q{
BEGIN
jobs.job_setup(lv_id => :parameter1,
lv_message => :parameter2,
lv_data => :parameter3,
lv_success => :success,
lv_error => :error);
END;
});
$sp->bind_param(":parameter1", $id);
$sp->bind_param(":parameter2", $message);
$sp->bind_param(":parameter3", $xml);
$sp->bind_param_inout(":success", \$success, 6);
$sp->bind_param_inout(":error", \$error, 10000);
$sp->execute;
};
if ($@) { print $error; }
The following is the stored procedure:
PROCEDURE job_setup
(
lv_id IN NUMBER,
lv_message IN VARCHAR2,
lv_data IN LONG,
lv_success OUT NUMBER,
lv_error OUT VARCHAR2
)
AS
BEGIN
/* update table */
UPDATE table
SET message = lv_message,
data = lv_data
WHERE id = lv_id;
COMMIT;
EXCEPTION WHEN OTHERS THEN
/* if errors, rollback and return false */
ROLLBACK;
lv_success := 0;
lv_error := SQLERRM;
END job_setup;
I realize setting $dbh->{LongReadLen} = to a very large number is basically meant for reading data (e.g. a select). Or does this effect insertion of long data too?
Has anyone else faced problems inserting very large values through Perl calling Oracle stored procs?
Thanks in advance for any help.