TLobLocator

peseps

Member
Hi,
I use the comp.library from allroundautomations :) and now I have a problem, I can't solve :(
With the following code snipped I get an exeption when performing the write Statement at the end.
I get the error Message ORA-22990 : 'only one transaction per LOB'

Can you help me to find ot what Im doing wrong. The record exists. And I just want to write some data to the BLOBField

var
iNmb : integer;
iBuffSize : integer;
cBuffer : PChar;
myLOB : TLobLocator;
begin
...

sSql := 'update TBL_XYZ set colBLOB = empty_blob() WHERE colID = :pID returning colBLOB into :pBLOB';

myQuery := TOracleQuery.Create (aForm);
myQuery.Session := aForm.OR_SES1;
myLOB := TLobLocator.Create(aForm.OR_SES1, otBLOB);

myQuery.DeclareVariable('pID', otString);
myQuery.DeclareVariable('pBLOB', otBlob);

myQuery.SetVariable('pID', sID);
myQuery.SetComplexVariable('pBLOB', myLOB);

myQuery.SQL.Add(sSql);
myQuery.Execute();

if not myLOB.IsNull then
begin
aStream := TMemoryStream.create();
gridView.StoreToStream(TStream(aStream));
iBuffSize := aStream.Size;
GetMem(cBuffer, iBuffSize);
myLOB.Write(cBuffer^, iBuffSize); //
 
Apparently you perform a commit or rollback after fetching the LOB and before writing the data. Could this be the case?
 
Back
Top