LongReadLen is an attribute, not a method.  You read or set it by
assignment:
   my $old_lrl = $h -> {LongReadLen};
   $h -> {LongReadLen} = 42; # bytes

>From the fine manual (run 'perldoc DBI' to see more):

=item C<LongReadLen> (unsigned integer, inherited)

This attribute may be used to control the maximum length of long fields
("blob", "memo", etc.) which the driver will read from the
database automatically when it fetches each row of data.  The
C<LongReadLen> attribute only relates to fetching and reading long values;
it
is not involved in inserting or updating them.

A value of 0 means not to automatically fetch any long data. (C<fetch>
should return C<undef> for long fields when C<LongReadLen> is 0.)

--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.
----- Original Message -----
From: "Corey Smith (s)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 19, 2001 11:09
Subject: setting LongReadLen


> I'm using Perl v5.6.1 on NT with DBI version 1.16, and am trying to do a
> select on a LONG RAW column.  As I understand it the default setting of
> LongReadLen is 0.  The error I get is :
>
> DBD::Oracle::st fetchrow_array failed: ORA-01406: fetched column value was
> truncated (DBD: ORA-01406 error on field 3 of 3, ora_type 24, DBI
attribute
> Long
> TruncOk not set and/or LongReadLen too small) at tde_generalDBI_2.pl line
> 15.
>
> I then tried setting LongReadLen like this:
> $dbh = DBI->connect('dbi:Oracle:','username','password') or die;
> $dbh -> LongReadLen(400);
>
>             $sth = $dbh -> prepare('SELECT * FROM .......');
>             $sth -> execute();
>
> I'm getting the following error when I execute the above code:
>
>     Can't locate object method "LongReadLen" via package "DBI::db"
(perhaps
> you forgot to load "DBI::db"?) at       tde_generalDBI_2.pl line 10.
>
> I'm stuck.  How do I reset LongReadLen? Any help would be greatly
> appreciated.  Thanks in advance.
>
> Corey
>

Reply via email to