Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating a view with a variable condition?
Message
 
 
À
02/05/2002 02:26:40
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00474379
Message ID:
00651800
Vues:
36
>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,

Thanks a lot, Walter. I think, your suggestion would probably work.

Here is a little bit more info, about what I want.

I have a form - selection criteria. User makes selection (picks state, geography, years range, etc.), then I need to present them results for view only. So, I would pass choosen state and where condition to the form. I would present result in a grid. Being a lazy programmer I though about designing this grid in design-time...

Anyway, I think, in this particular case I probably go with plain select into cursor instead of view. It's for view purpose only..
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