Subject Re: [IBO] Reading first X Bytes of a BLOB
Author Helen Borrie
At 10:08 PM 11/04/2008, you wrote:
>Hello!
>
>I'm reworking my document handling from the cursed M$-OLE-based crap I
>wrote previously to something more manageable. I'm going to use MIME
>multipart/form-data and found a simple parser.
>
>Since it is more manageable to put some of the information into fields
>before the actual files goes in, it would be a huge benefit for the
>GUI if...
>
>...it would be possible to get just the first X bytes of a blob in
>IBO? In IB_Session@2035 (IBO 4.6A) I can see:
>
> repeat
> GetSegment;
> until ( Result <> 0 ) and ( Result <> isc_segment );
>
>This suggests that even just getting the IB_BlobStream.BlobSize will
>get the whole blob down the line.

Blob segments aren't meaningful in any data sense. At the client end they can be used to set fetch and carry options across the network transport. At the server end, the server pleases itself about how it partitions the incoming or outgoing byte stream.


>Maybe the fbclient library can not handle such requests at all, but I
>suspect otherwise.

A *portion* of a non-text blob has no interpretable meaning, either to the server or to the client. The first n bytes of a binary blob are nothing but some unspecifed n bytes of "something".What would you expect to test or display?

You can pull a substring of a text blob via your SQL statement, of course.

Helen