Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to copy a line
Message
 
À
29/03/2006 08:37:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01108599
Message ID:
01108930
Vues:
11
Try this
SELECT * FROM Arinvd ;
      WHERE Arinvd.Ident IN (SELECT Arinv.Ident FROM Arinv WHERE InvDte > CTOD("01/01/2004")); 
      INTO CURSOR MyCursor

SELECT arinv_archive 
APPEND FROM  MyCursor

DELETE FROM Arinvd WHERE Arinvd.Ident IN (SELECT Ident FROM MyCursor)

DELETE FROM Arinv WHERE InvDte > CTOD("01/01/2004")
Another way is with :
DO WHILE ...
   ...
   DO WHILE
      SCATTER
      GATHER
   ENDDO
   ...
ENDDO
HTH

>this method i know but i want to do like this
>
>SELECT * FROM ARINV WHERE INVDTE > CTOD("01/01/2004") INTO CURSOR CUR_ARINV
>
>
>SELECT CUR_ARINV
>GO TOP
>
>
>DO WHILE NOT EOF()
>
> WAIT CUR_ARINV.INVNO WINDOW NOWAIT
>
> SELECT * FROM ARINVD WHERE ARINVD.IDENT = CUR_ARINV.IDENT INTO CURSOR CUR_DETAIL
>
> DO WHILE NOT EOF()
>
> WAIT CUR_DETAIL.INVLINE WINDOW NOWAIT
>
> ****copy the line to arinv_archive
> **** delete the line in the real table
>
>
> SELECT CUR_DETAIL
> SKIP 1
>
> ENDDO
> **** delete the line in the real table
> SELECT CUR_ARINV
> SKIP 1
>
>ENDDO
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform