Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to detect if a field is used in a remote view
Message
De
04/05/2005 05:46:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
04/05/2005 04:44:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01010684
Message ID:
01010690
Vues:
22
>Hi Guys,
>
>Is it possible to create a program that will list all of the remote views that uses a field I specified? or perhaps a table name that I specify?
>
>
>For example I have a field on my table items.oldField, I want to delete this field since it is no longer used in the system. I want to generate a list of all of the remoteviews that accesses this field so I may remove it from the view so that it won't produce an error if the view is used in the program.
>
>Any Idea?
>
>Thanks in advance.
m.lcDBC = "myDBC"
m.lcField = "oldField"
m.lcTable = Lower('Items')
Open Database (m.lcDBC)
Local ix
For ix=1 To Adbobjects(aViews,"VIEW")
  If DBGetProp(aViews[m.ix],"VIEW","SourceType") = 2 ;
      and m.lcTable$Lower(DBGetProp(aViews[m.ix],"VIEW","Tables")) ;
      and Indbc(aViews[m.ix]+'.'+m.lcField,"FIELD")
    ? m.lcField+" exist in view "+aViews[m.ix]
  Endif
Endfor
PS: You also check SQL explicitly I think because if you explicitly renamed its name then this wouldn't work.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform