Einzelnen Beitrag anzeigen

Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.768 Beiträge
 
Delphi 10.4 Sydney
 
#2

AW: how to extract a list from a query to pass it to the next function

  Alt 9. Jun 2020, 21:33
.. maybe it will work in that way

Best regards
Klaus

Delphi-Quellcode:
procedure fn1(var sl:TStringList);
var
...
qryPMV := TQuery.Create(nil);

qryPMV.DatabaseName := 'DB';
qryPMV.Close;
qryPMV.Sql.Clear;

qryPMV.Sql.Add('SELECT Distinct column1 PMV ');
qryPMV.Sql.Add('FROM MMV_DB ');
qryPMV.Sql.Add('Order by PMV ');
strSQL := qryPMV.Sql.GetText;
qryPMV.Open;


if not (qryPMV.bof and qryPMV.eof) then
  begin
    strHeader := 'PM_guys';
    WHILE not qryPMV.EOF do
      begin
        strOutputZeile := '';
        strPPV := strHeader + cTrenner + qryPMV.FieldByName('PM_VERANTWORTLICHER').AsString;
        strPPV := StringReplace(strPPV, cCRLF, cDelimiter, 1);
        sl.add(strPPV);
        qryPMV.next;
      end;
end;
Klaus
  Mit Zitat antworten Zitat