Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Index a table on a column in another table?
Message
De
05/03/2001 09:51:12
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Index a table on a column in another table?
Divers
Thread ID:
00481849
Message ID:
00481849
Vues:
56
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform