Subject Re: [IBO] TIB_DSQL and Active
Author Helen Borrie
At 11:29 AM 28/04/2006, you wrote:
>Here is a code snippet
>======================
>if not qryPhotoImg.Prepared then begin
> qryPhotoImg.Prepare;
>end;
>qryPhotoImg.Params[0].Clear;
>qryPhotoImg.Params[0].AsInteger := Key;
>qryPhotoImg.Execute;
>if qryPhotoImg.Active then begin
> tmpStream := TMemoryStream.Create;
>TIB_ColumnBlob(qryPhotoImg.FieldByName('IMG_PHOTO')).AssignTo(tmpStream);
> aImgHolder.LoadImg(Key,'',tmpStream);
>end;
>========================
>
>I want to be sure I have a BLOB before assigning it to a stream.

It doesn't look like a correct usage of an Execute operation to me
(though you still didn't provide an example).

Seriously, if you are somehow passing a key so you can pull over a
blob associated with that key, you should use a TIB_Cursor and a
SELECT statement. Trying to pass blobs in SP arguments is fraught
with problems architecturally.

Helen