Hi, I'm reading a table of 600.000 records to update an other table, for the frst time read within the same foxpro session it takes more than 60 seconds, the second time it takes less than 5 seconds. Any help?
here is the procedure:
SET ORDER TO CUSTID IN invoices
SELECT bilstmt
GO top
DO WHILE NOT EOF()
WAIT WINDOW NOWAIT STR(100*RECNO()/RECCOUNT())+'% Calculating Payments in display table'
mcust=custid
SELECT invoices
SEEK mcust
IF FOUND()
mflag=.f.
mtotpmt=0
DO WHILE custid=mcust
mpmt=cc1+cc2+cash
IF date>=mdateF AND date<=mdateT AND invstatus<>'V'
mtotpmt=mtotpmt+mpmt
ENDIF
SKIP 1
ENDDO
SELECT bilstmt
replace tot_pmt WITH mtotpmt + tot_pmt
ENDIF
SELECT bilstmt
SKIP 1
ENDDO
Tony Lama
Admigha SoftHouse
here is the procedure:
SET ORDER TO CUSTID IN invoices
SELECT bilstmt
GO top
DO WHILE NOT EOF()
WAIT WINDOW NOWAIT STR(100*RECNO()/RECCOUNT())+'% Calculating Payments in display table'
mcust=custid
SELECT invoices
SEEK mcust
IF FOUND()
mflag=.f.
mtotpmt=0
DO WHILE custid=mcust
mpmt=cc1+cc2+cash
IF date>=mdateF AND date<=mdateT AND invstatus<>'V'
mtotpmt=mtotpmt+mpmt
ENDIF
SKIP 1
ENDDO
SELECT bilstmt
replace tot_pmt WITH mtotpmt + tot_pmt
ENDIF
SELECT bilstmt
SKIP 1
ENDDO
Tony Lama
Admigha SoftHouse