Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can you finsih this up for me -smily face-
Message
 
 
À
15/06/1999 15:06:01
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00230111
Message ID:
00230148
Vues:
26
>This is an idea of what I have come up with so far, comon, lets fix it! What I did here was:
>-snip-
>SELECT WORKPO
>COPY TO temp FOR po = varpo
>USE temp IN 0
>SELECT temp
>COUNT TO ct
>-snip-
>-keep in mind that WORKPO and HISTPO have the field "PO" indexed-
>

First, create a parameterized view of WorkPO as a permanent member of a DBC:

create SQL View V_WorkPO as Select * from WorkPO where PO = ?nPO

Then you can:
use WorkPO order PO
use HistPO in 0 order PO
use V_WorkPO in 0 Nodata
set relation to PO into HistPO  && WorkPO is currently selected workarea
locate
do while !eof("WorkPO")
   nPO = WorkPO.PO
   requery("V_WorkPO")  && the view only has records with PO = nPO
   wait window nowait "V_WorkPO has " ;
      + alltrim(str(reccount("V_WorkPO"),6,0)) ; 
      + " record[s]."
   select HistPO
   if NOT eof("HistPO")
      ... blah...blah...blah
   endif
   select WorkPO
   skip while PO = nPO
enddo
Using the parameterized view will cut processing time down significantly. Better than copying to Temp table.


>wait window 'TEMP has more 1 records'
>SELECT histpo
>SEEK varpo
>IF FOUND()
> COUNT FOR po = varpo
> IF _tally = ct
> SELECT temp
> SEEK varpo
> SELECT histpo
> SEEK varpo
> FOR i = 1 TO _tally
> IF class = varclass AND ;
> fund = varfund AND ;
> udds = varudds AND ;
> amount = varamount AND ;
> fy = varfy AND ;
> activity = varactivity AND ;
> account = varaccount
> SELECT temp
> DELETE
> ELSE
>
> ENDIF
> ENDFOR
>
> ELSE
>
> ENDIF
>ELSE
> *APPEND to HISTPO
> SELECT workpo
> REPLACE which WITH '3'
>ENDIF
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform