Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select Into Table ... AddTive ?
Message
From
14/08/2002 08:20:57
 
 
To
14/08/2002 07:34:51
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00689477
Message ID:
00689487
Views:
18
This message has been marked as a message which has helped to the initial question of the thread.
>Hi ,
>
>I want make , perphaps 100 or more , Select , but i need results , in same Table . It´s possible ?
>
>
>Select CurCli
>GO TOP
>SET FILTER TO CurCli.Selecciona = .T.
>GO TOP
>
>DO WHILE .NOT. Eof()
>	IF Upper(AllTrim(CurCli.origem)) = "FACTDOC"   && FACTURA
>	
>	nNumDoc = CurCli.NumDoc
>	Select LinhaFac
>	GO TOP
>	SELECT * FROM LinhaFac INTO TABLE TmpLinFacX WHERE NumDoc = nNumDoc
>	
>&& I don´t want a new TmpLinFacX , i need write in end TmpLinFacX ( additive)
>	
>	ENDIF
>	
>	Select CurCli
>	SKIP
>	IF Eof()
>		EXIT
>	ELSE
>		LOOP
>	ENDIF		
>
>ENDDO
>
>
>Selec TmpLinFac
>DELETE ALL
>APPEND FROM TmpLinFacX
>
>
>Thanks
>Have a nice day


Pedro,

(1) I've changed the code a bit
(2) at the end there is what I believe to be a shorter and faster way
I haven't tested any of this

>
Selec TmpLinFac
DELETE ALL

>Select CurCli
>GO TOP
>SET FILTER TO CurCli.Selecciona = .T.
>GO TOP
>
>DO WHILE .NOT. Eof()
>	IF Upper(AllTrim(CurCli.origem)) = "FACTDOC"   && FACTURA
>	
>	nNumDoc = CurCli.NumDoc
>	Select LinhaFac
>	GO TOP
>	SELECT * FROM LinhaFac INTO cursor TmpLinFacX WHERE NumDoc = nNumDoc
        Select TmpLinFac
        append from (dbf('TmpLinFacX'))
  
>&& I don´t want a new TmpLinFacX , i need write in end TmpLinFacX ( additive)
>	
>	ENDIF
>	
>	Select CurCli
>	SKIP
>	IF Eof()
>		EXIT
>	ELSE
>		LOOP
>	ENDIF		
>
>ENDDO
>
>

>
or even better
select LinhaFac.* ;
   from LinhaFac, CurCli ;
   into table TmpLinFac ;
   where  ( CurCli.Selecciona ) ;
      and ( Upper(AllTrim(CurCli.origem)) = "FACTDOC" ) ;
      and ( LinhaFac.NumDoc == CurCli.NumDoc )
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform