TLOBLocator.Read

StKorn

Member
When I try to use TLOBLocator.Read(Buffer, SizeOf(buffer)) method, they always return SizeOf(buffer) value.

For example, this construction will be cause infinite loop:
repeat
ReadBytes := LOBLoc.Read(Buffer, SizeOf(buffer));
Inc(TotalBytes,ReadBytes);
until
ReadBytes = 0
end;

DOA 4.0.7 + Delphi 5 + Oracle 9.2 = this example work correctly.
DOA 4.1 + Delphi 6 + Oracle 9.2 = infinite loop.
 
Last edited:
This works fine for me. Here is my complete example:

Code:
procedure TForm1.Button1Click(Sender: TObject);
var LOBLoc: TLOBLocator;
    ReadBytes: Integer;
    TotalBytes: Integer;
    Buffer: array[0..999] of Byte;
begin
  with OracleQuery1 do
  begin
    Execute;
    LOBLoc := LOBField('c');
    repeat
      ReadBytes := LOBLoc.Read(Buffer, SizeOf(buffer));
      Inc(TotalBytes,ReadBytes);
    until ReadBytes = 0;
  end;
end;
 
Back
Top