Problem with fetching huge clob as single piece

PascalVB

Member²
Hi, i have issue when i try to get huge clob content as
sting, i receive error:
"ora-24817 Unable allocate gived chunk for current lob operation".

problem in TLobLocator.getString method
at line
rs := Read(Result[1], ASize * cs);

ASize * cs > 8mb

Is it possible to fix this in DOA?
 
Last edited:
Here is basic fix: is it posible to apply it in nearest bugfix release?
function TLOBLocator.GetString(ASize: Integer): string;
var cs, rs: integer;
bytesToRead: integer;
CurrentPosition: integer;
BlockSize: integer;
begin
if LOBType = otCLOB then cs := Session.CharacterSize else cs := 1;
SetLength(Result, Asize * cs);
Seek(soFromBeginning, 0);
CurrentPosition := 1;
BlockSize := 1048576*8;
BytesToRead := Asize * cs;
while (BytesToRead > 0) do begin
IF BytesToRead < BlockSize THEN BlockSize := BytesToRead;
rs := Read(Result[CurrentPosition], BlockSize);
IF rs = 0 then break;
Inc(CurrentPosition, Rs);
Dec(BytesToRead, rs);
end;
Setlength(result, currentposition-1);
if LOBType = otCLOB then Result := AddCR(Result, Session);
end;
 
Back
Top