![]() |
Datenbank: firebird • Version: 2 • Zugriff über: ibx
Tquery variabel die zweite
Hallo!
Ich habe 2 Tabellen in einer Firebird Datenbank. Jetzt möchte ich beide Tabellen auf einmal abfragen, mit folgendem Quelltext:
Delphi-Quellcode:
Das Problem liegt bei
procedure TForm1.AbfrageClick(Sender: TObject);
var SQLString1 , SQLString2 :String; begin Edit1.Text := AnsiUpperCase(Edit1.Text); If Combobox1.Text = '' then Combobox1.Text := ' Tabelle1 Tabelle2'; Screen.Cursor := crHourGlass; If Edit1.Text = '' then Edit1.Text := '..'; If Edit2.Text = '' then Edit2.Text := '..'; SQLString1:= StringReplace(Edit1.Text,'#','_',[rfReplaceAll]); SQLString1:= StringReplace(SQLString1,'..','%',[rfReplaceAll]); SQLString2:= StringReplace(Edit2.Text,'#','_',[rfReplaceAll]); SQLString2:= StringReplace(SQLString2,'..','%',[rfReplaceAll]); with Query1 do begin Active:=False; SQL.Clear; SQL.Add('Select * from '+ combobox1.text +' where feld001 Like :text1 '); SQL.Add('And Upper (feld002) Like Upper (:text2) '); ParamByName('text1').asString := SQLString1; ParamByName('text2').asString := SQLString2; Active:=True; end; Screen.Cursor := crDefault; end;
Delphi-Quellcode:
Ich habe schon die Möglichkeiten
If Combobox1.Text = '' then Combobox1.Text := ' Tabelle1 and Tabelle2';
Delphi-Quellcode:
sowie
... '' then Combobox1.Text := ' Tabelle1 and from Tabelle2';
Delphi-Quellcode:
und einige weitere ausprobiert. Leider ohne Ergebnis.
... '' then Combobox1.Text := ' Tabelle1, Tabelle2';
Manchmal wird Tabelle1 abgefragt und Tabelle2 nicht, meist bekomme ich Fehler 104 . Ich hoffe auf eure Hilfe. |
AW: Tquery variabel die zweite
Kannst du dem Thema bitte einen aussagekräftigen Titel geben? "die zweite" sagt rein gar nichts zum Problem aus. Man kann also nur raten um was es in dem Thema geht.
|
AW: Tquery variabel die zweite
![]() |
AW: Tquery variabel die zweite
Hi,
nur als Ansatz:
Code:
SELECT p.Feld1, f.Feld1 FROM tableP AS p, tableF AS f
Code:
SELECT p.Feld1, f.Feld1 FROM tableP AS p LEFT JOIN tableF AS f ON p.Feld1 = f.Feld1
|
AW: Tquery variabel die zweite
Zitat:
|
AW: Tquery variabel die zweite
Und wenn du "mit Firebird" anstelle von "die zweite" im Titel hinzufügst?
|
AW: Tquery variabel mit Firebird
Zitat:
@ himitsu Verbindet join nicht nur voneinander abhängige Tabellen? Ich möchte zwei unabhängige Tabellen nacheinander Abfragen und das Ergebnis in einem DBGrid darstellen. |
AW: Tquery variabel die zweite
![]() |
AW: Tquery variabel mit Firebird
Zitat:
|
AW: Tquery variabel die zweite
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:04 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz