Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rushmore?
Message
De
10/01/2005 08:59:05
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00975618
Message ID:
00975625
Vues:
37
>Is there any way to create Optimazible VFP local view. Current definition of the view is:
>
>CREATE SQL VIEW HonVed AS SELECT Hon.*, Homo.Ime;
>                FROM  honorar!hon  LEFT OUTER JOIN honorar!homo    ON  Hon.egn = Homo.egn+;
>                WHERE Hon.dataved = ?getdataved+;                  && Date field
>                AND IIF(hon_ved1,Hon.lev1==?get_lev1,.T.) = .T.+;  && Integer field
>                AND IIF(hon_ved2,Hon.lev2==?get_lev2,.T.) = .T.+;  && Integer field
>                AND IIF(hon_ved3,Hon.lev3==?get_lev3,.T.) = .T.    && Integer field
>
>
>I want this view to be optimazible
>User can change values of the hon_ved1,2,3
>How to Index Hon when some fields (Lev1, Lev2, Lev3) can contains Data # 0 but not take part in the view?
>i.e. Lev1 can contains Data # 0 but hov_ved1 can be .F. etc. so I can't index my Table (hon) on
>INDEX ON DTOS(DataVed)+STR(Lev1)+STR(Lev2)+STR(Lev3).
>Is there another way to make this View optimazable instead each time the user change values of hon_ved1,2,3 I regenerate the View?
>
>TIA

Borislav,

Are hon_ved1, hon_ved2 and hon_ved3 part of the table ?
Index on dtos(dataved) 
index on bintoc(lev1)   
index on bintoc(lev2)
index on bintoc(lev3)


CREATE SQL VIEW HonVed AS SELECT Hon.*, Homo.Ime;
                FROM  honorar!hon  LEFT OUTER JOIN honorar!homo    ON  Hon.egn = Homo.egn ;
                WHERE dtos(Hon.dataved) == dtos(?getdataved) ;                  && Date field
                AND IIF(hon_ved1,bintoc(Hon.lev1)==bintoc(?get_lev1),.T.) ;  && Integer field
                AND IIF(hon_ved2,bintoc(Hon.lev2)==bintoc(?get_lev2),.T.) ;  && Integer field
                AND IIF(hon_ved3,bintoc(Hon.lev3)==bintoc(?get_lev3),.T.)   && Integer field
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform