General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Macro expansion of view parameter
I need to contstruct a remote view using a variable WHERE clause. The syntax I have used is CREATE SQL VIEW MyView CONNECTION MyConnection AS SELECT * FROM MyTable WHERE &lcFilter. lcFilter could be something like 'MyField1=Value1 AND MyField2=Value2'.
When I USE MyView, I get the error "Connectivity error. Incorrect syntax near '&'." I also get this message if I change the view parameter to &?lcFilter.
If I change the parameter to ?&lcFilter, the error message is "SQL parameter is missing".
I have read on this forum that it is possible to use macro expansion in a view definition, so has anyone any idea what I might be doing wrong? How else can I set the WHERE filter at runtime for remote views? I am using VFP6/7 as a front-end to MSDE for development (SQL7 at client site).
Any help would be appreciated.
Alan Harris-Reid
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only