Data.DB.TParam.AsBlob

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type: property
Visibility: public
Source:
Data.DB.pas
Data.DB.hpp
Unit: Data.DB
Parent: TParam

Delphi

property AsBlob: TBlobData read GetAsBytes write SetAsBlob;

C++

__property TBlobData AsBlob = {read=GetAsBytes, write=SetAsBlob};

Description

Specifies the value of the parameter when it represents a binary large object (BLOB) field.

Set AsBlob to assign the value for a Blob field to the parameter. AsBlob takes a TBlobData (Delphi) or an AnsiString (C++) value, which can act as an untyped string of bytes. Setting AsBlob sets the DataType property to ftBlob.

For example, if the variable Buffer is of type PChar and contains binary data read from a file, the contents of Buffer are directly assigned to the BLOB parameter using the AsBlob property:

Query1.Params[0].AsBlob := Buffer;

Note: Applications seldom need to read AsBlob because Blob fields cannot be used as output parameters.

See Also