Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select Into Table ... AddTive ?
Message
 
 
À
14/08/2002 07:34:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00689477
Message ID:
00689495
Vues:
19
This message has been marked as the solution to the initial question of the thread.
First, you could replace your complicated DO WHILE with a simple SCAN.
llFirstTime = .T.
Select CurCli
SCAN FOR CurCli.Selecciona AND Upper(CurCli.origem) = "FACTDOC"
  SELECT * FROM LinhaFac ;
    WHERE NumDoc = CurCli.NumDoc ;
    INTO CURSOR crsTemp
  IF llFirstTime
    llFirstTime = .F.
    COPY STRUCTURE TO TmpLinFacX
    USE TmpLinFacX IN 0
  ENDIF
  SELECT TmpLinFacX
  APPEND FROM ( DBF("crsTemp"))
ENDSCAN
However, you can get the same result with single query.
SELECT LinhaFac.* FROM LinhaFac ;
  JOIN CurCli ON LinhaFac.NumDoc = CurCli.NumDoc;
  WHERE CurCli.Selecciona AND Upper(CurCli.origem) = "FACTDOC";
  INTO TABLE TmpLinFacX 
>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
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform