Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Blob to string conversion

1,758 views
Skip to first unread message

Rob

unread,
Nov 27, 2008, 3:22:21 PM11/27/08
to
I'm having a problem reading rtf blobs.
It seems to work on all XP machines and MOST Vista machines. Some
Vista instalations truncate the blob to string convertion.

I'm reading a blob from an ASA table and it reads back fine. When
converted to a string, it gets truncated to 32768 bytes on some Vista
machines.

Code for the read follows.

Any help would be apreciated.

... Rob


SELECTBLOB notes INTO :blob_notes FROM customer_notes WHERE
"customer" = :is_customer;
ls_notes = string(blob_notes )

Jeremy Lakeman

unread,
Nov 27, 2008, 5:46:24 PM11/27/08
to

I doubt it's the string conversion. Check the len() of the blob first.
Are you certain the blob made it into the table in one piece? Can you
call the equivalent of len() on the column?
The first culprit I'd look at is how the blob was read from a file and
inserted into the table. 32K is the maximum one call to fileread will
return so I think that would be the most likely cause.

Chris Pollach

unread,
Nov 28, 2008, 9:17:16 AM11/28/08
to
Hi Rob;

If you are connecting to ASA using ADO.Net or OLE-DB, you need to set the
"PBMaxBlobSize" parameter - otherwise it will default to 32K.

ie: SQLCA.DBParm="PBMaxBlobSize=200000"

HTH

--
Regards ... Chris
ISUG - NA RUG Director
http://chrispollach.pbdjmagazine.com


"Rob" <junk...@concepts.to> wrote in message
news:l20ui4lksodu25cqg...@4ax.com...

Rob

unread,
Nov 29, 2008, 11:12:58 AM11/29/08
to
I'm sure its the string translation.
I check the blob length and it's always good.
It's during the string translation that it gets truncated.

... Rob

Rob

unread,
Nov 29, 2008, 11:11:29 AM11/29/08
to
The blob is reading back form the database OK. I checked the length of
the blob and that was fine. It's always 2x the final string length on
WORKING vista stations but on the ones that show the problem, the blob
is the right size but the string is truncated.
I presume the parm only affects the read from database?

... Rob

On 28 Nov 2008 06:17:16 -0800, "Chris Pollach"

Rob

unread,
Dec 3, 2008, 9:10:17 PM12/3/08
to
Any other ideas?

... Rob

Jeremy Lakeman

unread,
Dec 4, 2008, 2:58:36 AM12/4/08
to
On Dec 4, 12:10 pm, Rob <junk_...@concepts.to> wrote:
> Any other ideas?
>
> ... Rob
>
> On 29 Nov 2008 08:11:29 -0800, Rob <junk_...@concepts.to> wrote:
>
> >The blob is reading back form the database OK. I checked the length of
> >the blob and that was fine. It's always 2x the final string length on
> >WORKING vista stations but on the ones that show the problem, the blob
> >is the right size but the string is truncated.
> >I presume the parm only affects the read from database?
>
> >... Rob
>
> >On 28 Nov 2008 06:17:16 -0800, "Chris Pollach"
> ><cpoll...@travel-net.com> wrote:
>
> >>Hi Rob;
>
> >>If you are connecting to ASA using ADO.Net or OLE-DB, you need to set the
> >>"PBMaxBlobSize" parameter - otherwise it will default to 32K.
>
> >>ie:  SQLCA.DBParm="PBMaxBlobSize=200000"
>
> >>HTH

Try writing out the blob to a file and taking a close look at the
contents with a hex editor?
Maybe there's an extra NULL character being inserted...
Other than that, no. No ideas what the cause is.

0 new messages