GetBlobLength

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Methods >

GetBlobLength

Declaration

function GetBlobLength( sFieldName: String ): LongInt;

Description

Retrieves the length of a BLOB that was stored in a memo field. A BLOB is a binary large object. The maximum size of an Apollo BLOB is 16 megabytes. Elements that contain fixed length strings may be stored and retrieved.

Parameters

sFieldName: The name of the memo field that holds the BLOB.

Return Value

The size of the BLOB as a long integer.

Delphi Example

procedure TForm1.bGetBlobClick(Sender: TObject);

var

 vpVar: Pointer; 

 lBlobSize: LongInt; 

 lWriteSize: LongInt; 

begin

 lBlobSize := ApTbl.GetBlobLength( 'notes' );

 Inc( lBlobSize ); 

 bBlobLen.Text := IntToStr( lBlobSize ); 

 GetMem( vpVar, lBlobSize ); 

 if ApTbl.GetBlob( 'NOTES', vpVar ) <> lBlobSize - 1 then 

         edGetBlob.Text := 'GetBlob Failed!' 

 else 

 begin 

         edGetBlob.Text := 'GetBlob Succeeded!'; 

         ApTbl.AppendBlank; 

         lWriteSize := ApTbl.PutBlob( 'NOTES', vpVar, lBlobSize ); 

         bBlobLen2.Text := IntToStr( lWriteSize ); 

         if lWriteSize <> lBlobSize then 

                 edPutBlob.Text := 'PutBlob Failed!' 

         else 

                 edPutBlob.Text := 'PutBlob Succeeded!'; 

 end; 

 FreeMem( vpVar, lBlobSize ); 

end;

See Also

GetBlob, PutBlob, Replace