Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Moin Robert, *,
On Mon, Jun 10, 2013 at 08:22:41PM +0200, Robert Großkopf wrote:
kurz zu den Platzhaltern bei LIKE-Bedingungen:

das nennst du kurz ;?

aus der HSQL-DB-Hilfe:

The LIKE keyword uses '%' to match any (including 0) number of
characters, and '_' to match exactly one character. To search for '%' or
'_' itself an escape character must also be specified using the ESCAPE
clause. For example, if the backslash is the escaping character, '\%'
and '\_' can be used to find the '%' and '_' characters themselves. For
example, SELECT .... LIKE '\_%' ESCAPE '\' will find the strings
beginning with an underscore.

Nun ja, ich wollte ja eigentlich nicht nach den Zeichen selber suchen,
sondern nur mal wissen, ob in LO/HSQL irgendwelche Zeichen nicht benutzt
werden können, weil sie in SQL „reserviert“ sind (fällt mir gerade kein
besserer Begriff ein, sorry ... :( Ich hoffe, du verstehst trotzdem, was
ich meine ... ;) ).

LIKE geht nur mit Strings. Die Sonderzeichen sind hier nur '%' für
beliebig viele und '_' für genau einen Buchstaben. '*' wird von der
grafischen Benutzeroberfläche in Base zu einem '%' umgewandelt. Das
erkenne ich daran, dass ich bei einer Abfrage mir den SQL-Code anzeigen
lasse und dann einmal SQL direkt ausführen lasse. Da wird auf LIKE 'W*'
nichts mehr rausgegeben, während bei 'W%' bei mir in dem Beispiel 3
Datensätze erscheinen.

O.K. Ich hatte es jetzt mal in meiner Beispieldatenbank probiert. Aber
weder mit * noch mit % bekomme ich eine Ausgabe, obwohl $Vorname und
$Name im Feld „Name“ eingetragen sind ... :( Wenn ich mir den SQL-Code
ansehe, ist das
<quote>
SELECT "Name", "Adresse", "Telefon" FROM "test" WHERE "Name" = 'Arno%'
LIMIT 2
</quote>
im konkreten Beispiel. Ein Eintrag mit „Arno Nym“ gibt es in der
Tabelle, aber warum wird der dann nicht angezeigt?
Danke, dass du/ihr euch für meine (dummen?) Fragen so viel Zeit
nehmt :)
Bis dann
Thomas.

-- 
The older I grow, the less important the comma becomes. Let the reader
catch his own breath.
                -- Elizabeth Clarkson Zwart

-- 
Liste abmelden mit E-Mail an: discuss+unsubscribe@de.libreoffice.org
Probleme? http://de.libreoffice.org/hilfe-kontakt/mailing-listen/abmeldung-liste/
Tipps zu Listenmails: http://wiki.documentfoundation.org/Netiquette/de
Listenarchiv: http://listarchives.libreoffice.org/de/discuss/
Alle E-Mails an diese Liste werden unlöschbar öffentlich archiviert

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.