Mike Yearwood
Toronto, Ontario, Canada
Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Network:
Windows 2003 Server
>>>I have found that "" will match almost anything when comparing. So I either use
>>>
>>>!EMPTY() .AND. next_condition...
>>>
>>>or, I use the == comparison operator...
>>
>>EMPTY() is not Rushmore optimizable unless you add indexes on EMPTY() which is a bad idea because their selectivity is low.
>>
>>== is best. For instance you can use upper(alltrim(field))=="" to find all records with empty(field). It works in both SQL and Rushmore.
>>
>>I only use empty() if I am not doing anything involving rushmore or sql.
>
>Are you sure upper(alltrim(field))=="" is Rushmore optimizable? Wouldn't you need an index on upper(alltrim(field)), which is a bad idea anyways? I use field == space(len(field)) instead of empty() to get optimization.
You're right.
lcEmpty = space(len(field))
field == m.lcEmpty
is what I prefer to do. The project I inherited is doing alltrim(upper( or upper(alltrim( everywhere and I'm losing my mind. The uppering isn't a problem, but the alltrim() is.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement