Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index a table on a column in another table?
Message
From
05/03/2001 10:18:49
 
 
To
05/03/2001 09:51:12
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00481849
Message ID:
00481865
Views:
13
Don't know if I am missing something here but... here goes...

Can't you just swap the parent child relation over?
Ie start thinking of the customer table as the parent and the invoice table as the child.

You would have to set up an index in the invoice table based on customer name
then set up the relationship.

Don't quite know if this will help

Will

>I would like to index a table on the value of a column in a related table. I know this sounds a little weird, but I need to do it (or something like it).
> The reason is for this scenario: I want to present records in the parent table in the order of data in a child table. For example: the parent table contains invoices. The child table contains customer names. I want to present the invoices ordered by the customer name.
> I do not want to create an SQL cursor, and I do not want to denormalize the data by placing the customer name in the invoice table. (However, both of these are possible fall back positions if nothing else works.)
> What I've done so far: I've created a non-structural index as follows:
> INDEX ON Customer.cName TAG cCustName OF ("(my index file name)")
>
> The reason for making the index non-structural is that I don't want the index to be permanently associated with the table because in other situations, the parent table might be used without the child table.
> I can create the index, but when I set up the two tables with a relation between them and set the parent table to the desired new index tag, the parent table is not sorted in the desired order.
> Is there any way to do this, or do I have to use a different approach?
>
> Thanks, Chaim
Will Jones
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform