Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro substitution in sql views no longer possible
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00975746
Message ID:
00975884
Vues:
56
Ahh, very good news!
We re-wrote the code to use SELECT... INTO CURSOR ..., instead of a view, but requerying is not as elegant (the view was indexed only once, and the current index did not change when requerying, while the cursor needs to be re-indexed and the current index re-set for every new set of records). I did not test for speed, in the instance we use it it does not seem to be an issue.
Is it now a documented feature? I looked in Help, and found the syntax '&lcMacrotest' (not '&?lcMacrotest') which does a different thing.
If it is not documented, how did you know the syntax has changed? I guess the current VFP9 way makes more sense... I remember that it's what was originally tried in VFP8, and it did not work, then it was found that '&lcMacrotest' with lcMacrotest not in scope worked.
Thanks.

>Doru,
>
>It still works in VFP9 but you have to code it differently:
>
>- The variable lcMacrotest has to be defined before view is created
>- The variable lcMacrotest should be precceded by '?' in the view
>
create sql view lvMacrotest as sele * from macrotest where &?lcMacrotest
>
>>The following worked in VFP 8, but it does not work in VFP 9
>>
create table macrotest free (f1 c(10), f2 c(10))
>>create database dbmacrotest
>>create sql view lvMacrotest as sele * from macrotest where &lcMacrotest
>>This was not documented, but it was nice. Macro was stored in the view expression as macro, and when the macro expression in scope changed, requery() expanded it.
>>Too bad... :(
Doru
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform