[V4MD] findAllLinked from two subTables

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Sep 21 11:22:48 CDT 2005


On 9/20/05 11:34 PM, "info at vallemediatime.com" <info at vallemediatime.com>
wrote:

> Ho Ruslan
> I try to explain you (better I can) with a simple example:
> 
> T1
> ID  |  Person  |  Phone  |  Code
> ------------------------------
> 1      Brown      123        1
> 2      Smith        456        2
> 3      Parker      287        1
> ....
> 
> T2
> ID  |  Course  |  Level
> ------------------------
> 1      Science     1
> 2      Math         1
> 3      Math         2
> ...
> 
> I create a link between T1<>T2
> 
> When I search allLinked I need to get, not only linked from T1 to T2 like
> this:
> eg find allLinked to Math, show from T1
> 1      Brown      123        1
> 2      Smith        456        2
> 
> but also the Person with Code = 2
> 2      Smith        456        2
> 
> in the same time (if possible) I wnat to get the Math Level 1 or 2 also
> 
> My idea is in this pseudo code;
> findAllLinked from T1 to T2
> show only T1 Person with Code = 1
> where T2 Linked Courses have Level = 2

So you want:

    * find in T1 some set of records
        you say: person with code = 1
    
    * Now you want find records of T2 linked to this set
        But only if T2.Level = 2

Right ?

I think you need:

    s1_t1 = Code.Find( 1 );

    s1_t2 = link.FindLinkedAsBitSet( s1_t1, T1, T2 )

Now you have set of records of T2.
You have 2 ways now:
  - just iterate and ignore/remove records that not satisfy you.
  - do search in T2 to get set2 with level = 2,
        and build intersection.
    
        

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list