JamesEricAndy
Member
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;
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;