hi,
I have the following code that inserts a string to an Oracle DB via a stored procedure:
use strict;
BEGIN {
$ENV{'TNS_ADMIN'} = '/auto/engweb/oracle/sqlnet';
$ENV{'ORACLE_HOME'} = '/usr/packages/dbdoracle/9.2.0';
}
use lib qw( /usr/packages/dbdoracle/9.2.0 );
use DBI;
use DBI qw(:sql_types);
use DBD::Oracle qw(

ra_types);
...
1 $pk = "<some_unique_value>";
2 $string = "<a very long string....>";
3 $stmt = 'BEGIN my_package.my_proc(

rimary_key, :value); END;';
# the my_proc stored procedure code looks like:
# PROCEDURE my_proc(primary_key IN VARCHAR2, col_val IN CLOB)
4 $sth = $dbh->prepare ($stmt);
5 $sth->bind_param("

rimary_key", $pk);
6 $sth->bind_param(":value", "$string");
7 $sth->execute();
...
for strings < 4Kb, the code works fine.
For strings > 4Kb, I see the following error messages. How do I resolve these errors?
-------------------------------
DBD::Oracle::st execute failed: ORA-01460: unimplemented or unreasonable conversion requested (DBD ERROR: OCIStmtExecute)
-------------------------------
I changed line 6 to:
$sth->bind_param(":value", "$string", SQL_LONGVARCHAR );
but saw the same error.
-------------------------------
I then tried:
$sth->bind_param(":value", "$string", SQL_LONGVARBINARY);
which produced:
DBD::Oracle::st execute failed: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments
-------------------------------
Next, I tried:
$sth->bind_param(":value", "$string", { ora_type => ORA_CLOB } );
but got:
DBD::Oracle::st execute failed: ORA-01403: no data found (DBD ERROR: LOB refetch
attempted for unsupported statement type (see also ora_auto_lob attribute))
Is there anything else I can try? Any pointer is appreciated.