Autor Beitrag
kabizolis
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 86



BeitragVerfasst: Mi 01.06.05 13:00 
bei meinem problem handelt es sich um ein MySQL-Problem...

Ich habe noch fast keine Erfahrung mit SQL ich Hasbe aber eine Suchfunktion in Delphi konstruiert, bei der man häckchen setzen kann, welche Sprachen man wählen will etc.

Der Code sieht so aus:

ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
SELECT
 Sprache.Sprachcode,
 CD.Produktbeschrieb,
 CD.Ausgabe,
 Kategorie.Kategorie, 
 User.Vorname,
 User.Nachname,
 Box.Name,
 Box.Boxnummer,
 CD.Fachnummer

FROM 
 Ausgeliehen,
 User,
 CD,
 Sprache,
 Box,
 Kategorie

WHERE
 CD.Sprache_ID = Sprache.ID
AND
 CD.Kategorie_ID = Kategorie.ID 
AND
 CD.Sprache_ID = Sprache.ID 
AND
 CD.Box_ID = Box.ID 
AND
 Ausgeliehen.User_ID = User.ID 
AND
 CD.Produktbeschrieb LIKE '%%'

AND Sprache IN 
 ('DE',
 'EN',
 'ES',
 'FR',
 'IT',
 'MUL',)

AND Boxnummer IN 
 (33248,
 32309,
 32706,
 26919,
 26752,
 30374,
 26990,
 33466,
 34391,
 31635,
 9310,
 32628,
 10244,
 30375,
 9181,
 7901,
 9694,
 31523,
 36307,
 36037,
 35923,
 34920,)


Das Problem besteht offensichtlich in den Sparten:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
AND Sprache IN 
 ('DE',
 'EN',
 'ES',
 'FR',
 'IT',
 'MUL',)


wahrscheinlich ist dieser befehl so nicht zulässig?!?!

je nachdem wo ein häckchen gesetzt ist, sollen die einzelnen Sprachcodes (DE, EN...) nicht angezeigt werden...

wer weiss rat?
neojones
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1206
Erhaltene Danke: 1



BeitragVerfasst: Mi 01.06.05 13:05 
Das Komma vor der abschließenden Klammer muss weg.

_________________
Ha! Es compiliert! Wir können ausliefern!
kabizolis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 86



BeitragVerfasst: Mi 01.06.05 13:11 
danke... wichtiger hinweis, hab' ich übersehen...
funktioniert trotzdem noch nicht!

das problem liegt darin, dass wohl der befehl [ AND bla IN ('1','2') ] in diesem fall keinen sinn macht...
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Mi 01.06.05 15:24 
So wie ich das sehe, ist Sprache ein Tabellenname, kein Feldname. Wenn ich deine Feldliste richtig interprtiere, muss es
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
AND Sprache.Sprachcode IN   
 ('DE',  
 'EN',  
 'ES',  
 'FR',  
 'IT',  
 'MUL')


heißen.

Stefan