Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select statement
Message
From
10/03/2004 07:11:56
 
 
To
09/03/2004 23:39:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00884712
Message ID:
00884771
Views:
35
Ryan,

Try using the JOIN clause in the select. I've found this to be faster by loads. Something like (I haven't tested it as I haven't the tables) e.g:

select po_main.vendno, po_main.company, po_main.drno, po_main.rcno, po_main.purno, po_main.loctid,;
po_main.adddate, po_main.addtime, po_main.adduser, po_main.org_rcno, ;
po_detail.item, po_detail.qtyrec, po_detail.umfact,;
po_detail.umeasur, po_detail.cost, po_detail.lineno, po_detail.taxrate, po_detail.qtyord, po_detail.qtyrec2,;
po_detail.disc, po_detail.qtyopen;
from po_main;
INNER JOIN po_detail on ;
po_main.purno == po_detail.purno ;
and po_main.rcno == po_detail.rcno ;
where alltrim(po_main.purno) == Lcvalue ;
and alltrim(po_main.rcno) == Lcvalue2 and ;
AND po_detail.qtyrec2 != 0 ;
into cursor cur_temp


I'm not sure what type of JOIN you need - look it up in help-SQL Select

HTH

Terry

>Hi to all,
>
>how can change this select statement to become faster.
>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
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform