Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating view programmatically
Message
De
23/10/2001 15:59:32
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
23/10/2001 11:33:24
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00572083
Message ID:
00572281
Vues:
30
This message has been marked as a message which has helped to the initial question of the thread.
>I am considering creating view programatically, instead of saving the definitions in the database. I am not (currently) asking how to do it; I will try to figure it out from the help, first.
>
>I think I may gain some flexibility, like having several slightly different versions of a view (say, with different parameters).
>
>What I do want to ask is:
>
>1) Is it very complicated to create views programatically?
>
>2) Is it worth the trouble? That is, perhaps there are too many problems involved, or perhaps there are better ways to do it.

You got the answers already. I also make the view manually, then run gendbc, then tweak a few things there (check the paths, for one, gendbc doesn't include paths to your tables, which creates problems if they're not all in the same directory).

My addition is to always keep views in a dbc of their own, so when they are created (programmatically) the dbc is created from scratch - I can do that because it has no tables in it. Second, I keep this dbc on user's temp drive, so everybody has one. Third, I re-create it as needed, which means that somewhere in oapp.init I compare the datetime of the executable with the datetime of this dbc, and recreate it as needed. The trouble with creating views programmatically is that there's no NoDataOnLoad for them at the point, so they do take time to get created, as they also open as well. A good workaround, at least for the parametrized ones, is to supply an impossible value for the parameter in the makeview_{name here} routine, so at least it doesn't pull any records, even if it has to open.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform