Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set relationship
Message
From
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:
01593600
Views:
46
>>
>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform