spletni strežnik sloHost novice Kazalo   rss reference izdelanih spletnih strani
slohost gostovanje spletnih strani in spletno gostovanje
SQL queries using "contain"

I'm struggling with the sytax for an SQL query.

The following does work for an exact match:
SELECT Code,DescriptionLong,BuyMultiple,ReorderQty,OnHandQty,Kit FROM 
Inventory
WHERE DescriptionLong = :Filter

I want to select records that contain the given text in one or more fields. Does Delphi support the "contains" keyword for Paradox tables?

If so, how do you implement it?

ANSWER

In SQL you use LIKE so for example

SELECT Code,DescriptionLong,BuyMultiple,ReorderQty,OnHandQty,Kit FROM Inventory WHERE DescriptionLong LIKE :Filter

Filter should use % for wildcards, so %text% would match anything field with the word text in it.

ANSWER

you can use like keyword

WHERE DescriptionLong like '%example string%'

ANSWER-REPLICA

Thanks guys. :-) That works well except it seems to be case sensitive.

I've used lower() in the SQL and :Filter to force it to work and the extra work is not affecting the speed of the query too much. (only 7000 items)

28.01.2005 [Število ogledov: 27]


registracija domen
spletno gostovanje
izdelava spletnih strani
webmail | webstat
 
OBISKOV: 1682598
DATUM: 14.11.2018
URA: 10:15:1
IP: 54.144.82.216
www.maleZivali.com
spletna trgovina - vse za vaše hišne ljubljenčke (pse, muce, ribe ...)
www.Lektoriranje.info
zahvala za lektoriranje
www.diskom.si
Računovodski in knjigovodski servis (računovodstvo in knjigovodstvo)
 
 
O strežniku sloHOST | Registracija domen | Spletno gostovanje | Izdelava spletnih strani
Vsa vsebina in fotografije, ki se nahajajo na tej spletni strani so avtorsko zaščitene in pripadajo avtorjem spletne strani slohost.net.
Vsebine in fotografije najdenih na tej spletni strani ni dovoljeno kopirati, razvijati, razmnoževati ali posredovati naprej brez avtorjeve privolitve.
Na spletni strani je predstavljena izdelava spletnih strani in spletno gostovanje na spletnem strežniku sloHOST ter registracija domen .com/.net/.org/.eu/.ei.