DBMS_Output.Get_Lines result is empty

I executed an Oracle script that contained DBMS_Output.Put_Line() commands.

I can then fetch the lines in DBMS_Output by using the DOA wizard generated code
TDBMS_Output.Get_Line in a loop.

However, I can NOT fetch the DBMS_Output lines using the DOA wizard generated code
"TDBMS_Output.Get_Lines". The parameter "Anumlines" = zero, and the "Alines" table is empty!

The DOA wizard generated code is the following:

procedure TDBMS_Output.Get_Lines(out ALines: TPLSQLTable; var ANumlines: Double);
begin
ALines := TPLSQLTable.Create(DefaultPLSQLTableSize, 255);
ThreadAcquire;
try
GetQuery;
OCPQuery.DeclareVariable('LINES', otString);
OCPQuery.DimPLSQLTable('LINES', ALines.TableSize, ALines.StringSize);
OCPQuery.DeclareVariable('NUMLINES', otFloat);
OCPQuery.SetVariable('NUMLINES', ANumlines);
OCPQuery.SQL.Add('begin');
OCPQuery.SQL.Add(' "SYS"."DBMS_OUTPUT"."GET_LINES"(');
OCPQuery.SQL.Add(' LINES => :LINES,');
OCPQuery.SQL.Add(' NUMLINES => :NUMLINES);');
OCPQuery.SQL.Add('end;');
OCPQuery.Execute;
ALines.ValueArray := OCPQuery.GetVariable('LINES');
ANumlines := ConvertVariant(OCPQuery.GetVariable('NUMLINES'));
except
ThreadRelease;
ALines.Free;
raise;
end;
ThreadRelease;
end;
 
PROCEDURE DBMS_OUTPUT.ENABLE
(buffer_size IN INTEGER DEFAULT 20000);
The ENABLE procedure enables calls to the other DBMS_OUTPUT modules. If you do not first call ENABLE, then any other calls to the package modules are ignored. The specification for the procedure is,
 
Hello,

DBMS_OUTPUT.GET_LINES (
lines OUT CHARARR,
numlines IN OUT INTEGER);

where numlines parameter is:
Number of lines you want to retrieve from the buffer.
After retrieving the specified number of lines, the procedure returns the number of lines actually retrieved. If this number is less than the number of lines requested, then there are no more lines in the buffer.
 
Back
Top