Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set Relation Command
Message
From
17/06/2004 11:20:51
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
17/06/2004 01:28:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00914271
Message ID:
00914634
Views:
19
>Thank you Mr. Zonneveld, The problem is i did not use a view or remote view. What i did was simply created two cursors and relate it. Is there a way that i can sort the child memory cursor on a different order?
>
>Hope you can help me on this. Thanks.

It is not worthwhile to try this with SET RELATION.

(Solution #1 - not recommended) I think it can be done, though, with an index that starts with the parent field, and continues with whatever you want to sort on.

(Solution #2) It is much better to use a view, and index it. A view is like an updatable query.

For example, suppose you have a table with 100,000 records. If you want the user to be able to sort on any column, or on combinations of more than one column, the only practical solution is temporary indices. With the first solution, you will have to create this temporary index on 100,000 records. This will be very slow.

If the child table has an average of 100 children for every parent, with a view (solution #2) the records will be fetched very quickly. Also, an index on only 100 records will be created very fast.

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform