ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/runtime/IBDataOutput.pas
(Generate patch)

Comparing ibx/trunk/runtime/IBDataOutput.pas (file contents):
Revision 47 by tony, Mon Jan 9 15:31:51 2017 UTC vs.
Revision 80 by tony, Mon Jan 1 11:31:07 2018 UTC

# Line 76 | Line 76 | type
76    public
77      constructor Create(aOwner: TComponent); override;
78      procedure Assign(Source: TPersistent); override;
79 <    procedure DataOut(SelectQuery: string; Add2Log: TAdd2Log);
79 >    function DataOut(SelectQuery: string; Add2Log: TAdd2Log): boolean;
80      procedure SetCommand(command, aValue, stmt: string; var Done: boolean); virtual;
81      class procedure ShowPerfStats(Statement: IStatement; Add2Log: TAdd2Log);
82    published
# Line 369 | Line 369 | begin
369            if ar = nil then
370              s += 'NULL'
371            else
372 <            s += TIBXMLProcessor.FormatArray(ar);
372 >            s += TIBXMLProcessor.FormatArray(Database,ar);
373          end;
374  
375        SQL_TEXT, SQL_VARYING:
# Line 504 | Line 504 | begin
504    end;
505   end;
506  
507 < procedure TIBCustomDataOutput.DataOut(SelectQuery: string; Add2Log: TAdd2Log);
507 > function TIBCustomDataOutput.DataOut(SelectQuery: string; Add2Log: TAdd2Log
508 >  ): boolean;
509   var Count: integer;
510   begin
511    FIBSQL.SQL.Text := SelectQuery;
# Line 515 | Line 516 | begin
516    if PlanOptions = poPlanOnly then
517      Exit;
518  
518  if IncludeHeader then
519    HeaderOut(Add2Log);
519    Count := 0;
520    FIBSQL.ExecQuery;
521    try
522 +    if IncludeHeader and not FIBSQL.EOF then
523 +      HeaderOut(Add2Log);
524      while (not FIBSQL.EOF) and ((FRowCount = 0) or (Count < FRowCount)) do
525      begin
526        FormattedDataOut(Add2Log);
# Line 530 | Line 531 | begin
531    finally
532      FIBSQL.Close;
533    end;
534 +  Result := Count > 0;
535   end;
536  
537   procedure TIBCustomDataOutput.SetCommand(command, aValue, stmt: string;
# Line 598 | Line 600 | var stats: TPerfCounters;
600   begin
601    if Statement.GetPerfStatistics(stats) then
602    begin
603 <    Add2Log(Format('Current memory = %d',[stats[psCurrentMemory]]));
604 <    Add2Log(Format('Delta memory = %d',[stats[psDeltaMemory]]));
605 <    Add2Log(Format('Max memory = %d',[stats[psMaxMemory]]));
603 >    Add2Log(Format('Current memory = %f',[stats[psCurrentMemory]]));
604 >    Add2Log(Format('Delta memory = %f',[stats[psDeltaMemory]]));
605 >    Add2Log(Format('Max memory = %f',[stats[psMaxMemory]]));
606      Add2Log('Elapsed time= ' + FormatFloat('#0.000',stats[psRealTime]/1000) +' sec');
607      Add2Log('Cpu = ' + FormatFloat('#0.000',stats[psUserTime]/1000) + ' sec');
608 <    Add2Log(Format('Buffers = %d',[stats[psBuffers]]));
609 <    Add2Log(Format('Reads = %d',[stats[psReads]]));
610 <    Add2Log(Format('Writes = %d',[stats[psWrites]]));
611 <    Add2Log(Format('Fetches = %d',[stats[psFetches]]));
608 >    Add2Log(Format('Buffers = %f',[stats[psBuffers]]));
609 >    Add2Log(Format('Reads = %f',[stats[psReads]]));
610 >    Add2Log(Format('Writes = %f',[stats[psWrites]]));
611 >    Add2Log(Format('Fetches = %f',[stats[psFetches]]));
612   end;
613   end;
614  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines