V4RB: Question to releases in the future

Claudius Sailer Claudius at sailer-online.de
Tue Jul 8 23:25:45 CDT 2003


Hi Ruslan,

I have the following Code in my app. where I insert from two 
SQL-Statement into an other table. In SQL I know, I know that I don't 
need the second table, because I can build the complete Cursor with one 
SQL-Statement and UNION. Will this be supported in V4RB 2.0 or isn't it 
planed to realize something like that?

At the moment I believe that ACTUAL SQL is slower than FUTURE SQL or is 
my point of view wrong?

bye

Claudius


ACTUAL SQL

     SQLString="SELECT B.RecID, B.BDatum, KZ.Konto_Name, 
K.Kategorie_Name, B.Betrag, B.Kommentar, B.Blocked"
     SQLString=SQLString+" FROM Buchungen B, Kategorien K, Konten KZ"
     SQLString=SQLString+" WHERE B.Kategorie_ID=K.RecID"
     SQLString=SQLString+ " AND B.Ziel_Konto=KZ.RecID"
     SQLString=SQLString+ " AND B.Herk_Konto='"+cstr(AktuellesKonto)+"'"

     cmd= "INSERT INTO Anzeige (Buchungs_ID, BDatum, Gegenkonto, 
Kategorie, Ausgabe, Kommentar, Blocked) "
     cmd=cmd + SQLString
     count=meineDatenbank.SQLExecute(cmd)

     //Einnahmen
     SQLString="SELECT B.RecID, B.BDatum, KO.Konto_Name, 
K.Kategorie_Name, B.Betrag, B.Kommentar, B.Blocked"
     SQLString=SQLString+" FROM Buchungen B, Kategorien K, Konten KO"
     SQLString=SQLString+" WHERE B.Kategorie_ID=K.RecID"
     SQLString=SQLString+ " AND B.Herk_Konto=KO.RecID"
     SQLString=SQLString+ " AND B.Ziel_Konto='"+cstr(AktuellesKonto)+"'"

     cmd= "INSERT INTO Anzeige (Buchungs_ID, BDatum, Gegenkonto, 
Kategorie, Einnahme, Kommentar, Blocked) "
     cmd=cmd + SQLString
     count=meineDatenbank.SQLExecute(cmd)

   //Listbox vorbereiten
   SQLString="SELECT RecID, * FROM Anzeige ORDER BY BDatum, Gegenkonto, 
Kategorie"
   CurBuchungen=meineDatenbank.SQLselect(SQLString)


FUTURE SQL


     SQLString="SELECT B.RecID, B.BDatum, KZ.Konto_Name, 
K.Kategorie_Name, 0, B.Betrag, B.Kommentar, B.Blocked"
     SQLString=SQLString+" FROM Buchungen B, Kategorien K, Konten KZ"
     SQLString=SQLString+" WHERE B.Kategorie_ID=K.RecID"
     SQLString=SQLString+ " AND B.Ziel_Konto=KZ.RecID"
     SQLString=SQLString+ " AND B.Herk_Konto='"+cstr(AktuellesKonto)+"'"

     SQLString=SQLString+ " UNION "

     //Einnahmen
     SQLString="SELECT B.RecID, B.BDatum, KO.Konto_Name, 
K.Kategorie_Name, B.Betrag, 0, B.Kommentar, B.Blocked"
     SQLString=SQLString+" FROM Buchungen B, Kategorien K, Konten KO"
     SQLString=SQLString+" WHERE B.Kategorie_ID=K.RecID"
     SQLString=SQLString+ " AND B.Herk_Konto=KO.RecID"
     SQLString=SQLString+ " AND B.Ziel_Konto='"+cstr(AktuellesKonto)+"'"

SQLString=SQLString+ " ORDER BY BDatum, Gegenkonto, Kategorie"



More information about the Valentina mailing list