The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



RetrieveBLOB


Unit:SDL_geodb
Class:TGeoDB
Declaration:[1] function RetrieveBLOB (DBEntry: integer; Filepath: string; var MetaInfo: TMetaInfo): boolean;
[2] function RetrieveBLOB (DBEntry: integer; var MetaInfo: TMetaInfo; PBLOBData: pointer; SizeOfBLOBData: integer): boolean;
[3] function RetrieveBLOB (DBEntry: integer; var MetaInfo: TMetaInfo; var BlobStream: TMemoryStream): boolean;

The method RetrieveBLOB retrieves binary data from the database and stores it either in a file (version [1]), or in a memory structure [2], or in a memory stream [3]. The parameter DBEntry addresses the database entry (DBEntry may take values between 1 and NumEntries). RetrieveBLOB returns a TRUE value if any binary data is available for the specified database entry.

The variable parameter MetaInfo contains the meta information about the BLOB.

Overloaded version [1] - retrieve to file:

The parameter FilePath specifies the destination file which is created when retrieving the binary data. Depending on whether FilePath contains a valid filename or only a path, RetrieveBLOB stores the data using either the FilePath parameter or the original filename (which is contained in Data[DBEntry].Name). Thus you can retrieve the BLOB using its original filename without even knowing it (if the database entry type is gitFileBlob).

Hint: Please note that the file size (in bytes) of the BLOB and its creation date are available in the Data property.

 

Overloaded version [2] - retrieve to memory structure:

The method RetrieveBLOB retrieves binary data from the database and copies it to the data structure referred to by PBLOBData. SizeOfBLOBData specifies the size of this data structure.

 

Overloaded version [3] - retrieve to memory stream:

This version of RetrieveBLOB retrieves the BLOB data and copies it into the stream BlobStream. Any previous data in the variable BlobStream is overwritten.

Hint: Retrieval times vary considerably for these three versions of RetrieveBLOB. The fastest (by several orders of magnitude) is version [2], the slowest is version [3]. Version [1] falls in between.



Last Update: 2023-Dec-13