Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to detect if a field is used in a remote view
Message
From
04/05/2005 05:46:05
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
04/05/2005 04:44:17
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01010684
Message ID:
01010690
Views:
21
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform