Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need INDEX long string.
Message
De
28/05/2003 12:06:31
 
 
À
28/05/2003 10:44:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00793472
Message ID:
00793571
Vues:
24
>Hi Sergey,
>
>data is binary BINTOC() path:
>
>BINTOC(1)BINTOC(74)BINTOC(87)BINTOC(134)BINTOC(456)BINTOC(1232)BINTOC(3433)BINTOC(567565)BINTOC(45635653)
>
>and it is on one memo field ( it is the path of the element on one tree structure without explicit level limit, true limit is 2^9/4 levels).
>
>I need index with lenght priority, or need padr with BINTOC(0).
>
>You have see, on past, someone, what has exceeded the limit of the 240 characters with some structure of indices of indices?
>
>I need this for fast traverse graph structure ( graph is one multipath tree )
>
>Fabio

Fabio,

Can this work to avoid the long keys ?
create cursor Tree ;
   Parent I default 0, ;
   Child  I default 0, ;
)
select Tree
Index on bintoc(Parent) tag Parent  && optional
index on bintoc(Child) tag Child  && optional

index on  bintoc(Parent) + bintoc(Child) tag Down

&& depth first
Function Traverse(StartNode)

    local r
    r = recno()

    =seek(bintoc(StartNode)) 

    scan rest while( bintoc(StartNode) == bintoc(Parent) )
       =Traverse(Child)
    endscan

    go (r)
endfunc
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform