var LOB: TLOBLocator;
Buffer: array[0..99] of Byte;
begin
// insert into lobtable (id, lobcolumn) values (:id, empty_blob())
// returning lobcolumn into :lobcolumn
with LOBQuery do
begin
SetVariable('id', 1);
// Create a new BLOB (initially Null)
LOB := TLOBLocator.Create(Session, otBLOB);
// Assign it to the returning variable
SetComplexVariable('lobcolumn', LOB);
Execute;
// After the insert, use the LOB Locator to write the data
LOB.Write(Buffer, 100);
LOB.Free;
end;
end;