Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution in sql views no longer possible
Message
From
12/01/2005 15:43:41
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00975746
Message ID:
00976543
Views:
44
Hi Doru,

Where did you read that "this use of macro sub in views is not supported..."?

If you are surmising this because it's not documented, then you probably should stay completely away from macro substitution altogether, because I can't recollect a single command or function documented as 'supports' (or not) macro substitution. I admit that my reading about views is small and long ago.

Jim

>Hi Walter,
>I thought '&?' makes it clearer, when you see the SQL, that the variable is a parameter. I also like that in VFP9 you must define the variable before you can create a view, or else you get an error. In VFP8, you could create the view with or without the variable defined (and in scope), but it was stored as a macro only if the variable was not defined - so you had to remember that.
>Unfortunatelly this use of macro sub in views is not supported, and not docummented, so I'll try to stay away from using it, because I don't want to have to deal with broken code when going from one version to another.
>
>>Guenter,
>>
>>It seems that omitting the ? in VFP9 is not supported. Don't ask me why. I'm as stumped as you are.
>>
>>Walter,
>>
>>>>>create sql view lvMacrotest as sele * from macrotest where &?lcMacrotest
>>>I don't understand why this is this way.
>>>- In VFP7 both strategies work (&cWhere and &?cWhere)
>>>- In VFP8 only &cWhere works
>>>- In VFP9 only &?cWhere weems to work
>>><<
>>
>>>Hey Walter, what is this &? all about? Why would I need a ? after & for macro sub here?
>>>Thx
>>>G
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform