Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro substitution slow
Message
 
 
À
23/06/2000 17:31:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00383777
Message ID:
00384139
Vues:
48
Hi Bob,
>
>>select * from contacts where &pcFilterString into table c:\temp\foundit
>>
>>pcFilterString='UPPER(NLAST)="SMITH" AND UPPER(NFIRST)="JOHN"'
>
>Could you replace the macro variable with this snippet:
>lcLast = 'SMITH'
>lcFirst = 'JOHN'
>Select * from contacts where UPPER(NLAST)==lcLast AND UPPER(NFIRST)==lcFirst into table c:\temp\foundit
>
>or if you dont know the field names, you can use the Eval() function:
>lcField1 = 'UPPER(NLAST)'
>lcField2 = 'UPPER(NFIRST)'
>Select * from contacts where EVAL('lcField1')==lcLast AND EVAL('lcField2')==lcFirst into table c:\temp\foundit

Instead of == try to use lcField1 like lcLast+'%'

>>
>>The table is indexed on UPPER(NLAST AND UPPER(NFIRST) and the query runs quickly with the values instead of the macro substitution
>
>If at all possible, you need to remove the macro variable.
>
>Jon
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform