Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quickly find field names in tables
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00037420
Message ID:
00037425
Views:
27
> If you have a field name and want to find which table it's in quickly and > efficiently, is there anything better than the following: > > SELECT table1 > =AFIELDS(aArray1) > FOR i = 1 TO ALEN(aArray1,1) > IF myfield = aArray1(i,1) > itsintable1 = .T. > ENDIF > IF itsintable1 = .T. > SELECT table2 > =AFIELDS(aArray2) > FOR i = 1 TO ALEN(aArray2,1) > IF myfield = aArray2(i,1) > itsintable2 = .T. > ENDIF > > ...or is this what I have to do, unless I work around it? If the tables are in the .DBC, then you could open the .DBC and select objectname ; from {DBC} ; where objectid in ; (select parentid from {DBC} where ObjectType = "Field" and ObjectName = m.MyField) ; into array laTables /Paul
Paul Russell
EMail: prussell@fox.nstn.ca
Phone: (902) 499-5043
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform