Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Probems with LONG datatypes and DBD

Re: Probems with LONG datatypes and DBD

From: <bracher_at_my-dejanews.com>
Date: Fri, 30 Apr 1999 16:14:01 GMT
Message-ID: <7gcks5$1r$1@nnrp1.dejanews.com>


In article <37286850.8659275_at_news.bigpond.com>,   mgharvey_at_bigpond.com (Lisa Harvey) wrote:
> The later versions of DBD-Oracle report an error by default if a long
> value is truncated during a fetch (only the first 80 bytes are fetched
> by default). There is DBD property to disable this: I think it is
> something like long_trunc_ok.
> ie. to allow truncation of longs:
> $db->long_trunc_ok = 1;

  $h->{LongTruncOk} = 1;

but that may not be what you want... the long will still truncate, dbi just won't warn you about it. also consider

  $h->{LongReadLen} = n;

where n is the max in bytes to read before truncating. this property defaults pretty low, and used to mod by 65535 so that 65534 was the largest value that you could realistically specify. I've heard that this restriction is lifted on O8, but wouldn't know for sure since all my servers are still 7.3.4.

to complicate things further, I tend to set LongReadLen _very_ low (say 16 bytes or so), assume that it will truncate, and read all long/long raw data with an iterated blob_read() since some of my data is longer than 65534 bytes...

best of luck...

> You should be able to find details in the DBD-Oracle documentation.
>
> Regards,
> Michael.
>
> On Thu, 29 Apr 1999 13:47:01 +0100, "Paul Davies"
> <cobalt_at_dircon.co.uk> wrote:
>
> >I'm using the latest version of Oracle on Linux with DBD.
> >
> >When I try to retrieve the value of a column of type LONG using a simple
> >SELECT statement I come across the following error:
> >
> >A Truncation or null fetch error occurred....
> >
> >Can someone help me understand the problem?
> >
> >They query works just fine in SQL Plus

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Apr 30 1999 - 11:14:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US