Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
While vrs. SQL (while is so speed)
Message
From
30/04/1998 21:08:21
Fernando España
Alta Tecnologia En Informatica
Guatemala, Guatemala
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
While vrs. SQL (while is so speed)
Miscellaneous
Thread ID:
00096194
Message ID:
00096194
Views:
53
I have a table with 15250326 records and I have problem with speed, I make a question and every body say USE A SQL-Select
this is very fast, but i try to do this and the sql-Select is very slow, but using a while is more fast
**when skip
Select sum(amount) as amount from Detail where ID_Customer=;
thisform.customerid.value into array Total_cust
thisform.customertotal.value=total_cust
thisform.refresh

this take a seven seconds in a Pentium 166 mmx with 32 Mb. ram
runing on a NT 4.0 lan with 100 workstations working in the same program.

the time ig good but if I need skip record by record the elapsed time is very slow, the I do the next:

**when Skip
Select Detail
**the detail table is order by ID_Customer
if seek(thisform.customerid.value)
Sum(amount) to thisform.customertotal.value while idcustomer=;
thisform.customerid.value
thisform.refresh
Select Customers
Endif

this proces take two seconds and is very fast!!!

Can somebody tellme why while is more quick than a SQL ?

thanks

Sory for my English!!!
Fernando España
SQL Server Specialist
Next
Reply
Map
View

Click here to load this message in the networking platform