Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Defining views.
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00540683
Message ID:
00540686
Vues:
22
I don't know of any "official" mechanism to check whether a view exists or not. You could probably try with something like this.
lViewExist = .T.
ON ERROR lViewExist = .F.
use MyView
if not lViewExist
   * create view 
endif
Also, you can look for the view using the the DBC as a table.
use MyDBC
locate for ObjectType = 'View' and ObjectName = 'MyView'
lViewExist = found()
>Hello,
>
>I do not like so much to define the views in the DBC and to distribute the DBC.
>Because of this, I define the view always in code in the program. But the problem here is performance: it takes quite some time. So I would like to check whether it is necessary to update the view definition: Does the view exist, has the view definition changed etc.
>Especially whether the view exists I could not figure out in code.
>If this is possible, then I just create the view when it does not exist, otherwise I do not need to create the view. And in the upgrade procedures (with a new version) I create all views again.
>
>What is the syntax for checking whether a view exists?
Hector Correa
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform