Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counting Child Records
Message
 
 
To
07/05/2002 20:53:03
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00653805
Message ID:
00653810
Views:
24
I think, we have to test this statement. It seems right logically, but not necessary might be true...

BTW, as I understood, we have related tables...

I'll run some tests later tonight...

>The COUNT() example will be faster (assuming there is an appropriate index) to first SEEK() and then do a COUNT WHILE instead of FOR. As I recall the FOR condition will read all the records in the table - the WHILE will only read until the condition is no longer true - less records to read.
>
>>>I have two tables related together and want to be able to count the number of associated child records whenever I move the pointer in the parent table.
>>>
>>>How do I do this?
>>>
>>>Thanks!
>>
>>Use either Select SQL (if tables unbuffered) or count, e.g.
>>
>>select child
>>lnRecno=recno()
>>count for ChildID = m.lnParentID to lnChildren
>>go to lnRecno
>>select Parent
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform