Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select
Message
De
10/03/2004 06:21:37
 
 
À
10/03/2004 03:17:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Select
Divers
Thread ID:
00884738
Message ID:
00884763
Vues:
9
Hi Ryan,

PLease don't make a new thread unless it is a NEW thread! You have already got many tips, which are very good in deed.

1. Drop the ALLTRIM, it is not optimizable. Unless you have an index on ALLTRIM, which you must not use unless you love to take risks!!!!!
2. replace the == with = and set exact on in stead

Remember you must have an index on the clause before = in the the where statements.
>
select a.vendno,a.company,a.drno,a.rcno,a.purno,a.loctid,;
a.adddate,a.addtime,a.adduser,a.org_rcno,b.item,b.qtyrec,b.umfact,;
b.umeasur,b.cost,b.lineno,b.taxrate,b.qtyord,b.qtyrec2,;
b.disc,b.qtyopen;
from po_main a, po_detail b ;
where a.purno = Lcvalue and a.rcno = Lcvalue2 and ;
a.purno = b.purno and a.rcno = b.rcno AND b.qtyrec2 # 0 into cursor cur_temp

So you must have an index on purno in a and rcno in 2

>Hi to all,
>
>any other way to this statement to make it fast.
>i need a replacement for this statement co'z it's very slow.
>please help
>
>thanks.
>
>select a.vendno,a.company,a.drno,a.rcno,a.purno,a.loctid,;
>a.adddate,a.addtime,a.adduser,a.org_rcno,b.item,b.qtyrec,b.umfact,;
>b.umeasur,b.cost,b.lineno,b.taxrate,b.qtyord,b.qtyrec2,;
>b.disc,b.qtyopen;
>from po_main a, po_detail b ;
>where alltrim(a.purno) == Lcvalue and alltrim(a.rcno) == Lcvalue2 and ;
>a.purno == b.purno and a.rcno == b.rcno AND b.qtyrec2 != 0 into cursor cur_temp
>
>select cur_temp
>go top
>scan
>insert into ictran01 (..,) values (cur_temp.,,,)
>select cur_temp
>endscan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform