CreateBlobStream method |
Applies to
TIB_Statement
Declaration
Function CreateBlobStream(AColumn: TIB_Column; AMode: TIB_BlobStreamMode ): TIB_BlobStream;
Description
Method which allows direct access to the contents of a BLOB parameter or
field.
Here is some sample code showing how to use this method:
procedure TIB_ColumnBlob.LoadFromStream( const AStream: TStream );
var
tmpStream: TStream;
begin
tmpStream := Statement.CreateBlobStream( Self, bsmWrite );
try
tmpStream.CopyFrom( AStream, 0 );
finally
tmpStream.Free;
end;
end;
procedure TIB_ColumnBlob.SaveToStream( const AStream: TStream );
var
tmpStream: TStream;
begin
tmpStream := Statement.CreateBlobStream( Self, bsmRead );
try
AStream.CopyFrom( tmpStream, 0 );
finally
tmpStream.Free;
end;
end;