Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SELECT UPDT
SCAN
** SELECT THE TARGET REPLACE WORKAREA
SELECT DELSHDVL
REPLACE PCS WITH UPDT.PCS FOR PLN_CD=UPDT.PLN_CD .AND. SHP_STYLE=UPDT.SHP_STYLE .AND. LOT=UPDT.LOT
** SCAN WILL RESELECT UPDT
ENDSCAN
SELECT UPDT
SCAN
REPLACE DELSHDVL.PCS WITH UPDT.PCS FOR DELSHDVL.PLN_CD=UPDT.PLN_CD .AND. DELSHDVL.SHP_STYLE=UPDT.SHP_STYLE .AND. DELSHDVL.LOT=UPDT.LOT
ENDSCAN
But it could be suggested that I am wasting a SELECT statement
SELECT UPDT
SCAN &&UPDT
.. do something
ENDSCAN && UPDT
SELECT DELSHDVL
INDEX ON PLN_CD+SHP_STYLE+LOT TAG DELSHDVL
SELECT UPDT
SCAN && UPDT
SELECT DELSHDVL
SET ORDER TO DELSHDVL
** PLN_CD+SHP_STYLE+LOT
SEEK (UPDT.PLN_CD+UPDT.SHP_STYLE+UPDT.LOT)
DO WHILE .NOT. EOF() .AND. PLN_CD+SHP_STYLE+LOT = (UPDT.PLN_CD+UPDT.SHP_STYLE+UPDT.LOT)
REPLACE DELSHDVL.PCS WITH UPDT.PCS
SKIP
ENDDO
ENDSCAN && UPDT
SELECT DELSHDVL
INDEX ON PLN_CD+SHP_STYLE+LOT TAG DELSHDVL
SELECT UPDT
SCAN && UPDT
SELECT DELSHDVL
SET ORDER TO DELSHDVL
** PLN_CD+SHP_STYLE+LOT
SEEK (UPDT.PLN_CD+UPDT.SHP_STYLE+UPDT.LOT)
SCAN WHILE PLN_CD+SHP_STYLE+LOT = (UPDT.PLN_CD+UPDT.SHP_STYLE+UPDT.LOT) && DELSHDVL
REPLACE DELSHDVL.PCS WITH UPDT.PCS
ENDSCAN && DELSHDVL
ENDSCAN && UPDT
UPDATE Delshdvl SET Pcs=UPDT.Pcs FROM Delshdvl ;
INNER JOIN UPDT ON Pln_Cd=UPDT.Pln_Cd AND Shp_Style=UPDT.Shp_Style AND Lot=UPDT.Lot
UPDATE _DelDtl SET Delvr_Pcs=UPDT.Delvr_Pcs FROM _DelDtl ;
INNER JOIN UPDT ON _DelDtl.Style=UPDT.Style AND nStylecode=UPDT.nStylecode AND cLotName=UPDT.cLotName
UPDATE _DelDtl SET Delvr_Pcs=UPDT.Delvr_Pcs FROM _DelDtl ;
INNER JOIN UPDT ON _DelDtl.Style=UPDT.Style AND _DelDtl.nStylecode=UPDT.nStylecode AND _DelDtl.cLotName=UPDT.cLotName
*SELECT updt
*SCAN
* UPDATE Delshdvl ;
* SET Pcs=UPDT.Pcs ;
* WHERE Pln_Cd = UPDT.Pln_Cd ;
* AND Shp_Style = UPDT.Shp_Style ;
* AND Lot = UPDT.Lot
*
*ENDSCAN
#define theKey Pln_Cd + Shp_Style + Lot
SELECT updt
INDEX ON theKey TAG tmpKey
SELECT Delshdvl
SET RELATION TO theKey INTO updt
REPLACE ALL pcs WITH updt.pcs FOR NOT EOF("updt")
SET RELATION OFF INTO updt
SELECT updt
DELETE TAG tmpKey
* And if you do this regularly, you can define the key and not have to create it or delete it
#define theKey Pln_Cd + Shp_Style + Lot
SELECT Delshdvl
SET RELATION TO theKey INTO updt
REPLACE ALL pcs WITH updt.pcs FOR NOT EOF("updt")