AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Datenbanken Delphi how to extract a list from a query to pass it to the next function
Thema durchsuchen
Ansicht
Themen-Optionen

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

Ein Thema von piedad · begonnen am 9. Jun 2020 · letzter Beitrag vom 18. Jun 2020
 
piedad

Registriert seit: 5. Jun 2020
10 Beiträge
 
#1

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

  Alt 9. Jun 2020, 17:52
Datenbank: SQL • Version: QDA Version9 • Zugriff über: Delphi
Hi Guys,
I am fighting with a piece of Code and can not move Forwards, do you a have a hint for a Delphi SQL beginner?

I want to extract a list of names from a Database for making a return in my function and after that passing that to another function in my big program.
1. I tried following Code making a big program and I got my csv table with the column of names, but if I try to separate my big program in Little modules, it does not work any more
I got by Debugging a run time error E/AFehler 103 when evaluating the instruction PushVar($0,$0,0,$0,$0,'Result'9. in the Position: (***)
I am sure it is a very stupid Thing, but I cannot catch it now.
2. it is possible to Export this Little query to assign it to my fn1 result for passing this value to the function fn2?
thnaks a lot in Advance and Kind regards
Piedad


function fn1:String;
var
...
qryPMV := TQuery.Create(nil);
tsSQLListe := TStringList.create;

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';
Writeln(tfFilePointer, strHeader); (***)

WHILE not qryPMV.EOF do
begin
strOutputZeile := '';
tsSQLListe.Add(cTrenner + qryPMV.FieldByName('PM_VERANTWORTLICHER').AsString );
strPPV := StringReplace(tsSQLListe.text, cCRLF, cDelimiter, 1);
strOutputZeile := strPPV;

tsSQLListe.Clear;
Writeln(tfFilePointer, strOutputZeile);
qryPMV.next;

end;
end;

CloseFile(tfFilePointer);
  Mit Zitat antworten Zitat
 

 

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:18 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz