Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to copy a line
Message
 
To
29/03/2006 08:37:31
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01108599
Message ID:
01108930
Views:
13
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
Previous
Reply
Map
View

Click here to load this message in the networking platform