Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Given a field in data.dbc get the table
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01257776
Message ID:
01257792
Views:
10
Would you say it is necessary to include 'ObjectType = 'Table' in the where clause?

E.g.
select objectname ;
from YourDBC ;
where objectname = 'Table' AND objectid = (select top 1 parentid from YourDBC where objecttype='Field' and objectname='YourField' order by 1)


>Aaron,
>
>You can try something like this
>
>
>select		objectname ;
>	from	YourDBC ;
>	where	objectid = (select top 1 parentid from YourDBC where objecttype='Field' and objectname='YourField' order by 1)
>
>
>
>[Update]
>
>Careful with the casing, I used 'YourField', but I understand the fields are stored lowercase always in the DBC
>
>[Update 2]
>Also, you should better have a SET DELETED ON
>
>>I have a scenario where I need to go to the DBC to find a field's table name. In this scenario, I am assured that field names in the DBC are unique.
>>
>>Has anyone done this before, in an efficient SQL statement. I know this can be done with multiple passes on the DBC inspecting [objectname], [objecttype] and [parentid]...
>>
>>Any help is most appreciated.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform