The docs say:

Changing the value of C<LongReadLen> for a statement handle after it
has been C<prepare>'d will typically have no effect, so it's common to
set C<LongReadLen> on the C<$dbh> before calling C<prepare>.

Tim.

In-Reply-To: <[EMAIL PROTECTED]>; from Mikage Sawatari on Wed, Aug 
08, 2001 at 11:09:26PM +0900

On Wed, Aug 08, 2001 at 11:09:26PM +0900, Mikage Sawatari wrote:
> 
> Hello.
> 
> I use DBD::Oracle 1.08 by Oracle9i, however I SELECT LOB values, 
> the following errors will occur.
> 
> DBD::Oracle::st fetchrow_array failed: ERROR fetching field 2 of 1.
> LOB value truncated from 6000 to 80. DBI attribute LongReadLen too small
> and/or LongTruncOk not set at bugtest.pl line 54.
> 
> Which appends the script (bugtest.pl) to reproduce --
> this script changes a few things which were running by Oracle8i.
> 
> Thanks.
> 
> Taku Sano (Mikage Sawatari)
> 
> --- CUT HERE (bugtest.pl) ---
> 
> =head CREATE SAMPLE TABLE
> 
> CREATE TABLE lobtest (
> data CLOB NOT NULL
> );
> 
> =cut
> 
> BEGIN
> {
>   $ENV{ORACLE_HOME} = '/home/oracle/OraHome';
>   $ENV{LD_LIBRARY_PATH} = "$ENV{LD_LIBRARY_PATH}:$ENV{ORACLE_HOME}/lib";
>   $ENV{ORACLE_SID} = 'MANA';
>   $ENV{ORACLE_TERM} = 'vt100';
>   $ENV{ORA_NLS33} = "$ENV{ORACLE_HOME}/ocommon/nls/admin/data";
>   $ENV{PATH} = "$ENV{PATH}:$ENV{ORACLE_HOME}/bin";
>   $ENV{NLS_LANG} = 'american_america.UTF8';
>   $ENV{NLS_DATE_FORMAT} = 'YYYY-MM-DD HH24:MI:SS';
> }
> 
> 
> use DBI;
> use DBD::Oracle qw(:ora_types);
> 
> $db = DBI->connect('dbi:Oracle:',q{mikage/xxxxxxxx},'', {
>   AutoCommit => 0,
>   PrintError => 0,
>   RaiseError => 1
>   });
> $db->trace(2, 'trace.log');
> 
> my $dataid = 1;
> my $ldata = 'aya' x 2000; # 6000 bytes.
> 
> my $sth = $db->prepare(q{
>   INSERT INTO lobtest
>     VALUES (?)
>     });
> 
> $sth->bind_param(1, $ldata, { ora_type=>ORA_CLOB, ora_field=>'data' });
> $sth->execute;
> $db->commit;
> 
> 
> $sth = $db->prepare(q{
>   SELECT data FROM lobtest
>   });
> #$sth->{LongTruncOk} = 1;
> $sth->{LongReadLen} = 65536;
> $sth->execute;
> 
> my $data = $sth->fetchrow_array;
> 
> $db->commit;
> 
> $db->disconnect;
> 
> 
> 
> 
> --- CUT HERE ---
> 
> 
> 

Reply via email to