Autor Beitrag
Klaus D.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63



BeitragVerfasst: Fr 14.11.03 19:47 
Hallo
Wie bekomme ich in folgenden Code den LIKE-Operator eingestzt,
damit ich das "OnChange"Ereignis eines SuchEdit's nach jeder Eingabe auswerten kann.
SELECT * FROM tbl_Adresse t1, tbl_Beruf t2 WHERE t2.Beruf = 'Maler' AND t1.SID_Beruf = t2.ID_Beruf :?:


Main-Tabelle
SID_Beruf=(t1)SEK-Schlüssel

Nachschlagetabelle
ID_Beruf =(t2)Primärschlüssel
Beruf =(t2)ist das eigentliche Datenfeld

Danke
Klaus

Moderiert von user profile iconTino: Titel geändert.
grayfox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 800

win98, winXP
D4 Standard; D6 Personal
BeitragVerfasst: Sa 15.11.03 01:04 
hallo klaus!

du meinst das doch nicht etwa so, oder?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
{$UNTESTED}
  SELECT * FROM tbl_Adresse t1, tbl_Beruf t2 
  WHERE (t2.Beruf LIKE SuchEdit.Text)  
  AND (t1.SID_Beruf = t2.ID_Beruf)


ich hatte dein anliegen in diese richtung gehend verstanden.

mfg, stefan
Klaus D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63



BeitragVerfasst: Sa 15.11.03 10:30 
Hallo

Das passt immer noch nicht. Unter folgenden Link habe ich mein Test-Prog. zum Download gelegt. Es handelt sich um:

ADS-Database
Alias:ZZTop

Das eigentliche Problem ist wesentlich komplexer aber ich möchte erst einmal das Prinzip verstehen deshalb nur diese Testdatabase.

Danke für euer Bemühen.
Tschö klaus Dabergott

www.daberehlert.de/SQL-Test.Zip
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 17.11.03 08:52 
Hallo,

ich kenne mich mit Datenbank nicht so aus aber das Beispiel von grayfox müsste doch so aussehen oder?

ausblenden Delphi-Quelltext
1:
2:
3:
  SQL := 'SELECT * FROM tbl_Adresse t1, tbl_Beruf t2'
    + 'WHERE (t2.Beruf LIKE ' + SuchEdit.Text + ')'
    + 'AND (t1.SID_Beruf = t2.ID_Beruf)'


Gruß
Tino
grayfox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 800

win98, winXP
D4 Standard; D6 Personal
BeitragVerfasst: Mo 17.11.03 16:30 
man soll eben so zeitig am morgen keine beiträge erstellen :wink:

ausblenden Delphi-Quelltext
1:
2:
3:
  SQL := 'SELECT * FROM tbl_Adresse t1, tbl_Beruf t2' 
    + 'WHERE (t2.Beruf LIKE ' + QuotedStr(SuchEdit.Text) + ')' 
    + 'AND (t1.SID_Beruf = t2.ID_Beruf)'


wenn man den text, nach dem gesucht werden soll, noch in doppelte klammern stellt, dann sollte es gleich viel besser funktionieren ;)

mfg, stefan