Blob writing problem
Posted: 12.09.2007, 14:02
Hi all!
I have ZEOS 6.6.1-beta, Delphi 2006 and FB 2.0.
When I try to update a blob in DB in such a way:
the blobs in all records (not only where id=fUserId) are updated with the content from the stream (seems like there is no WHERE condition in SQL).
Is this a bug?
I have ZEOS 6.6.1-beta, Delphi 2006 and FB 2.0.
When I try to update a blob in DB in such a way:
Code: Select all
procedure TUserSettings.WriteToDb;
var
stream: TMemoryStream;
begin
with TZQuery.Create(fDbConnection) do
try
Connection := fDbConnection;
SQL.Clear;
SQL.Add(Format('SELECT user_settings AS data FROM g2_user WHERE id=%d', [fUserId]));
Open;
Edit;
stream := TMemoryStream.Create;
fData.SaveToStream(stream); //Here, fData is TXMLDocument (doesn't much matter imho)
(FieldByName('data') as TBlobField).LoadFromStream(stream);
Post;
finally
Free
end;
end;
Is this a bug?