Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am having a problem with DBI and Oracle.

I am doing what I think is a pretty simple DBI call. When I execute I get the following ERROR.

DBD::Oracle::st fetchrow_array failed: ERROR fetching field 2 of 4. LOB value truncated from 80 to 80. DBI attribute LongReadLen too small and/or LongTruncOk not set at D:\monographs\printmono.pl line 114.

Now one of the columns I am selecting is a text CLOB. Is that why I am getting this? Do I need to set a parameter in DBI to deal with the problem? Where is some good dbi documentation.

Thanks
Brett

Edit by tye

  • Comment on DBI fetch fails with "LOB value truncated from 80 to 80"

Replies are listed 'Best First'.
Re: DBI fetch fails with "LOB value truncated from 80 to 80"
by blakem (Monsignor) on Nov 09, 2001 at 01:41 UTC
    Try setting the LongReadLen and LongTruncOk params on your dbh handle....
    $dbh->{LongReadLen} = 66000; $dbh->{LongTruncOk} = 1;

    -Blake

      blakem is correct. A bit more info: This is from memory (haven't got the right book to hand) but should be roughly right. ;)

      hth,
      andy.

        Since nobody asked the obvious follow-up to my node, I'll do it myself....

        Q: What should LongReadLen actually be? How did you arrive at 66000?

        A: I dunno... cut'n'pasted it from some of my old code, itself being cut'n'pasted from a usenet post. If anyone knows the significance of 66000 or has another "favorite" value, I'd love to hear about it.

        -Blake

      The below given dbh is working as expected. thanks
      Twenty years on... this particular piece of arcane wizardry is still hitting the spot!