Autor Beitrag
Hendrik
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324



BeitragVerfasst: Mi 09.04.08 11:19 
Hey!


Wenn ich über die Where - Klausel die Suche auf leere Felder (IS LIKE NULL) einschränke, werden logischer Weise nur Felder angezeigt, in denen nichts drin ist. Wurde aber in das Feld zunächst etwas hineingeschrieben, dann aber wieder gelöscht, so ist es quasi auch leer, hat jedoch nicht mehr den Wert NULL und wird dementsprechend nicht bei mir angezeigt.

Wie kann ich denn solche Felder abfragen?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 09.04.08 11:22 
ausblenden SQL-Anweisung
1:
 IS NULL or ''					

_________________
Markus Kinzler.
Hendrik Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324



BeitragVerfasst: Mi 09.04.08 12:29 
Das hatte ich auch schon probiert, aber das macht er leider auch nicht!

Fehler:

Unexpected end of command - line 1, column 53

Invalid token.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 09.04.08 12:41 
Natürlich
ausblenden SQL-Anweisung
1:
... where <feld> is null or <feld> = '' ...					

_________________
Markus Kinzler.
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Mi 09.04.08 12:47 
Soll das einer übersetzen oder was ? :shock: Auf deutsch : "unerwartetes Ende des Kommandos" Reicht das ? :mrgreen:

_________________
Gruß
Hansa
Hendrik Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324



BeitragVerfasst: Mi 09.04.08 12:56 
Nene das ist schon klar! Da hatte ich eben einfach nur einen Tippfehler drin, sorry ;)

Aber leider findet er mit dem LIKE '' gar nichts... Das ist das, was ich nicht verstehe! <>'' klappt, ='' leider nicht... Habt ihr da noch eine Idee? Länger will ich euch dann auch nicht nerven!
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 09.04.08 12:59 
Es muss auch ='' heißen. Leerzeichen kannst du mit Trim() eliminieren:

ausblenden SQL-Anweisung
1:
... where <feld> is null or Trim(<feld>) = '' ...					

_________________
Markus Kinzler.
Hendrik Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324



BeitragVerfasst: Mi 09.04.08 13:00 
Danke es geht!
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 09.04.08 13:03 
Besser wäre es aber beim Update leere Textfelder auf NULL zu setzen.

_________________
Markus Kinzler.