Board index » delphi » Updating Blob field using ADOQuery

Updating Blob field using ADOQuery


2005-11-02 10:31:38 PM
delphi95
I am attempting to update a blob field in an Oracle record using ADOQuery and a BlobStream, but I don't seem to have the syntax (or approach) correct yet.
An example of what I am attempting to do is as follows:
==================================================
Qry_MiscTmp.Active := False;
Qry_MiscTmp.SQL.Clear;
Qry_MiscTmp.SQL.Add('SELECT * from ' + Qualifier + '.MYTABLE');
Qry_MiscTmp.SQL.Add('where UID = ' + IntToStr(UID_C));
try
Qry_MiscTmp.Active := True;
except
MessageDlg('Unable to select data record',mtError,[mbOK],0);
Exit;
end;
// =========================
//
// =========================
Qry_MiscTmp.Edit;
Raw := Qry_MiscTmp.CreateBlobStream(Qry_MiscTmp.FieldByName('Blob1'), bmReadWrite);
try
Raw.Seek(0, soFromBeginning); //Seek beginning of stream
for I := 0 to MyStruct.ArrayCount -1 do begin
DVal := MyStruct.Array1[I];
Raw.Write(DVal, SizeOf(DVal));
end;
except
{ generate error message]
end;
raw.free;
Qry_MiscTmp.Active := False;
===================================================
The code excutes but the resulting record has nothing in the blob field.
Can anyone point me in the right direction on this??
TIA
 
 

Re:Updating Blob field using ADOQuery

You should free blobstream and Post AdoQuery.