How to access child objects in hierarchical database setup

Arthur Clemens aclemens at xs4all.nl
Sun Nov 2 20:31:46 CST 2003


On 2-nov-03, at 19:20, Ruslan Zasukhin wrote:

> on 11/2/03 19:34, Arthur Clemens at aclemens at xs4all.nl wrote:
>
>>> Back to your question.
>>> Let you have RecID of some ParentTable record,
>>> Now you want find its child records.
>>>
>>> You need do simply:
>>>
>>>     ArraySet* pChilds = childTable.ptr.FindAsArraySet( &RecID );
>>>
>>>
>>> Note, since in most cases the count of childs will not be not huge, 
>>> it
>>> is
>>> better to use ArraySet.
>>
>> I was worried about the speed issue of retrieving the children.
>> Especially as I need to do that with every Record occurrence in view.
>> If I have a table view with visible window of 30 items, I need to do
>> this 30 times per update, for instance with scrolling...
>
> But there is no faster way.
>
> Only if pre-built some lists of linked records....

Yes, I can investigate this.

> So you have 30 parent records in view.
> Each parent record linked to n (how much?) child records.
> You have found child records...
> What next? You should all them?  30 * n records?

No, in the table scroll view I will only show the Slovene word, that is 
one field of the child item. On clicking the rest of the information 
will be shown in a bigger display.

Arthur



More information about the Valentina mailing list