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....



AddBLOB


Unit:SDL_geodb
Class:TGeoDB
Declaration: [1] function AddBLOB (FileName: string; Date: TDateTime; StateFlag: longint; LatLow, LatHigh, LongLow, LongHigh, Altitude: single; ClassNumber: byte; UserTag: longint; MInfo: TMetaInfo): integer;
[2] function AddBLOB (Name: string; Date: TDateTime; StateFlag: longint; LatLow, LatHigh, LongLow, LongHigh, Altitude: single; ClassNumber: byte; UserTag: longint; MInfo: TMetaInfo; PBLOBData: pointer; SizeOfBLOBData: integer): integer;
[3] function AddBLOB (Name: string; Date: TDateTime; StateFlag: longint; LatLow, LatHigh, LongLow, LongHigh, Altitude: single; ClassNumber: byte; UserTag: longint; MInfo: TMetaInfo; Data: TMemoryStream): integer;
[4] function AddBLOB (FileName, FNameInDB: string; Date: TDateTime; StateFlag: longint; LatLow, LatHigh, LongLow, LongHigh, Altitude: single; ClassNumber: byte; UserTag: longint; MInfo: TMetaInfo): integer;
[5] function AddBLOB (FileName, FNameInDB, OrgFilePath: string; Date: TDateTime; StateFlag: longint; LatLow, LatHigh, LongLow, LongHigh, Altitude: single; ClassNumber: byte; UserTag: longint; MInfo: TMetaInfo): integer;

The method AddBLOB adds a BLOB to the database. AddBLOB is available in five versions which differ in the source of the binary data and the handling of file names. Versions [1], [4], and [5] load the data from a disk file, version [2] loads it from a data structure, and version [3] loads the data from a stream.

The parameter FileName contains the filename (including the full path specification) of the BLOB file (versions [1], [4], and [5]). Versions [4] and [5] allow to store the BLOB under a name (FNameInDB) different from the original filename. In versions [1] and [4] the original file spec is stored in the meta information of the BLOB, in version [5] the parameter OrgFilePath is stored as the original file path (despite the file has been loaded from a different path/name). Version [5] is especially useful if you have to store a file under different database name and a fake original filename.

Version [2] adds the data referred to by PBLOBData. The parameter SizeOfBLOBData specifies the size of the data structure to be added. Version [3] takes the data from the stream Data. The parameter Name (versions [2] and [3]) contains the name of the BLOB data. The data is stored as a BLOB using the database entry type gitBLOB.

The parameter Date holds the date and time associated with the BLOB. If Date is set to 0.0 the creation date of the file is stored in the database. The parameter StateFlag reflects the state of the database entry. The parameters LatLow ... LongHigh specify the geographical area the BLOB is associated with. The parameter Altitude defines the altitude of the BLOB data. ClassNumber contains the number of the class the new database entry should belong to, and the UserTag parameter may hold a user-defined number. UserTag is not used by the database system, it can be used to store additional information. The parameter MInfo contains the meta information of the BLOB.

The function AddBLOB returns the database entry number of the newly created entry, or a value of -1 if an error occurred.

Hint: The sub-property FilePath of the meta information is filled in automatically if using version [1] or [4], all other meta information variables have to be set by the user before calling AddBLOB.



Last Update: 2012-Oct-20