Data.SqlExpr.TSQLBlobStream.Create

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

constructor Create(Field: TBlobField; Mode: TBlobStreamMode = bmRead);

C++

__fastcall TSQLBlobStream(Data::Db::TBlobField* Field, Data::Db::TBlobStreamMode Mode);

Properties

Type Visibility Source Unit Parent
constructor public
Data.SqlExpr.pas
Data.SqlExpr.hpp
Data.SqlExpr TSQLBlobStream

Description

Creates and initializes an instance of TSQLBlobStream.

Call Create to obtain an instance of TSQLBlobStream for reading from a specific TBlobField object in a TCustomSQLDataSet descendant.

Field specifies the BLOB field from which to read data.

The Mode parameter is provided for compatibility with other BLOB stream constructors. However, in TSQLBlobStream, the Mode parameter is ignored because dbExpress datasets are read-only. SQL Blob streams can only be used to read BLOB data.

Create links the TSQLBlobStream to the field object specified by the Field parameter. It then calls ReadBlobData to read the information from the BLOB field into a memory buffer, where it is available for reading.

Warning: If you write to the SQLBlobStream using inherited methods, you are overwriting the in-memory buffer that is filled by the constructor. This will cause subsequent read operations to provide inaccurate information, because the BLOB stream no longer accurately reflects the contents of the BLOB field.

Instead of calling the TSQLBlobStream constructor, you can also use the dataset's CreateBlobStream method.

See Also