Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set relationship
Message
 
To
07/02/2014 03:18:32
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01593576
Message ID:
01593619
Views:
53
>>>
>>>Is there a better quicker way to do this with SQL? I know I can use set relation with 2 tables. But the help in VFP 9 does not say much about additive, although I
>>>suppose it must be what it sounds like.
>>>
>>>Thanks, Steve
>>
>>
>>CLOSE ALL
>>SELECT 1
>>USE table4
>>INDEX on mindex TO g
>>SELECT 2
>>USE table5
>>INDEX on mindex TO gg
>>SELECT 3
>>USE table6
>>INDEX on mindex TO ggg
>>SELECT 4
>>USE table7
>>INDEX on mindex TO gggg
>>SELECT 5
>>USE table8
>>INDEX on mindex TO o
>>SELECT 6
>>USE table9
>>INDEX on mindex TO oo
>>
>>SELECT 1
>>SET RELATION TO mindex INTO table5 additive
>>SET RELATION TO mindex INTO table6 additive
>>SET RELATION TO mindex INTO table7 additive
>>SET RELATION TO mindex INTO table9 additive
>>SET RELATION TO mindex INTO table10 additive  && after 4 set relation's, foxpro says the following: Table10 is not found
>>
>
>You don't need all these Index commands, if you do it right. Open these tables, one by one, in the command window. Then issue the command "Index on mindex tag mindex". Once you have done this, these index tags will be automatically updated.
>
>To use the tables afterwards, you use the command "Use table1 order mindex in 0". This syntax also makes the command "Select x" commands redundant.
>
>Having said that, I also suggest using SQL commands instead whenever possible.

Is this the kind of thing you mean?
CLOSE ALL
Use table4 IN 0  ALIAS t4
USE table5 IN 0  ALIAS t5
USE table6 IN 0  ALIAS t6
Index on mindex tag mindex
SELECT t4     && at this point, if I try a "Use table1 order mindex in 0"  I get a "table or file already open" type message"
REINDEX
But at this point the set relation commands are not really performing? I can issue:
SET RELATION TO mindex INTO t5 additive
SET RELATION TO mindex INTO t6 additive
But the following don't work as expected
browse fields t4.mindex, t5.mindex, t6.mindex   && each row going across should all have the same value, but they no longer do?
Thank you, Steve
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform