Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a view with a variable condition?
Message
From
02/05/2002 02:26:40
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00474379
Message ID:
00651724
Views:
40
Hi nadya,

>Do you know, how can I create view with variable table name, e.g.
>select * from (lcTable) where &?cWhere

I don't think this is possible directly. Further, the fields in a view must be stable or else you will rais "Base tables have been changed" error. If you're trying to use one view for various tables with the same fields in it, you can do the following:
USE someTable ALIAS ViewSource

CREATE SQL VIEW MyView AS ;
   SELECT * FROM ViewSource WHERE &?cWhere
Now you can open any table as ViewSource and use this as basis for your view. I'm not sure though if you can make it updateble since you have to include the sourcetables in the DBSETPROP() functions.

I guess this takes a little exmerimentation.

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform