Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Difference between IN and $ in Views/SQL
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Network:
Windows NT
Database:
Visual FoxPro
Divers
Thread ID:
00991852
Message ID:
00992562
Vues:
20
Hi Elgin

Just a small word in favour of INLIST which may or may not be relevant depending on the nature of the search comparison.

I have discovered that searches using '$' are not Rushmore optimized and are significantly slower than using INLIST. Because VFP does not support macro substitution with remote views (for reasons which I fail to understand) it means that for a remote view you would need to build an expression that is big enough to contain all the options you want.
m.cString = PADR('ADFR', 10, '^')
FOR x = 1 TO 10
	m.cVar = [m.v]+TRANSFORM(m.x)
	&cVar = SUBSTR(m.cString, m.x, 1)
ENDFOR
SELECT * ;
	FROM myTable
	WHERE INLIST(tablevar, m.v1, m.v2, m.v3, m.v4, m.v5, m.v6, m.v7, m.v8, m.v9, m.v10)
>Am I correct in assuming that the proper, and only way, to search for a string CONTAINED within a given field is to use the CONTAINS operator within my SQL statement like this:
>
>SELECT * FROM nameplat WHERE ALLTRIM(UPPER(lcSearchString)) $ (field_searched).
>
>And does "field_searched" have to be an actual fieldname, or can it be a variable that is used to reference any of several fields that the user can choose from.
>
>I am trying to give the user the ability to do "fuzzy searches" on a few select fields.
>
>Thank You.
May all your weeds be wildflowers
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform