Subject Re: [IBO] TIB_DSQL
Author Lucas Franzen
Hi Michael,

haven't emailed quite a long time ;-)

Michael Vilhelmsen schrieb:

> Hi
>
> As mentioned earlier today I'm about to convert from TIBOQuery to
> either TIB_Cursor or TIB_DSQL.
> Now I know how to use TIB_Cursor.
> Thank you both Jason and Lucas.
>
> But now I have a little problem with TIB_DSQL.
> I have some inserts, which I at this point do like this:
>
> Ins_Table.ParamByName('MyBlob').AsBlob := Memo.Lines.Text;


when I save / load Blobs from / to Memos (or RTF) I use something like:
(in my example it's a TIB_Cursor not a TIB_DSQL)

Save Memo-content To Blob-column

with myCursor do
begin
Memo.Lines.SaveToStream (
TIB_BlobStream.CreateForColumn (
FieldByName ( 'MY_BLOBFIELD' ), bsmWrite ) );
end;

Load Memo from Blob column:

with myCursor do
begin
Memo.Lines.LoadFromStream (
TIB_BlobStream.CreateForColumn (
FieldByName ( 'MY_BLOBFIELD' ), bsmRead ) );
end;

I think this should be valid for ParamByName in a TIB_DSQL, too.

Luc.