Subject | Re: [firebird-support] UDF receiving and returning BLOB (pascal) |
---|---|
Author | Vlad Khorsun |
Post date | 2008-11-20T22:52:05Z |
> Hi all,BufferSize must be Short
>
> I=B4m writing an UDF to receive any BLOB and return it as another BLOB,
> converted to hexadecimal
>
> Ex: select ps_blob_to_hex(cast('ABC' as blob sub_type 0)) returns a
> blob containing '414243'
>
> I used some pieces of code from FreeUDFLib, and almost everything is
> working, except for the problem below:
>
> // I=B4m using these data structures to represent a Firebird BLOB
>
> TISC_BlobGetSegment =3D function(BlobHandle: PInt; Buffer: PChar;
> BufferSize: Long; var ResultLength: Long): Short; cdecl;
> TISC_BlobPutSegment =3D procedure(BlobHandle: PInt; Buffer: PChar;...
> BufferLength: Short); cdecl;
>
> TBlob =3D record
> GetSegment: TISC_BlobGetSegment;
> BlobHandle: PInt;
> SegmentCount: Long;
> MaxSegmentLength: Long;
> TotalSize: Long;
> PutSegment: TISC_BlobPutSegment;
> end;
>
> If i select from the second table, where the size of the blobs areYou must PutSegments by pieces less then 32K
> larger, it works just on the some records (i presume the records wich
> blob size are below <=3D 32K).
Regards,
Vlad