Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
'Dynamic' SQL
Message
De
23/01/2001 08:02:27
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
 
À
23/01/2001 07:11:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00467190
Message ID:
00467202
Vues:
16
Gadi,

What I would do is CREATE CURSOR or use a "template" table for the structure and AFIELDS(laMyArray) and CREATE CURSOR FROM ARRAY laMyArray to create a writable cursor for yourself.

Then do your loop:
CREATE CURSOR MyCursor (Field1 I, ...)
DO WHILE ...
  SELECT Whatever INTO CURSOR Temp
  SELECT MyCursor
  APPEND FROM DBF([Temp])
ENDDO
If you don't have a lot of data each time you can
CREATE CURSOR MyCursor (Field1 I, ...)
DO WHILE ...
  SELECT Whatever INTO ARRAY laTemp
  SELECT MyCursor
  APPEND FROM ARRAY laTemp
ENDDO
>Hi All,
>
>I need to perform a SQL query number of times and gather the data into the same CURSOR. I can't use subqueries because the number of SQL is data dependent. I want to perform somthing like the following:
>
>local i
>...
>Do while i>0
>
>Select ...
>from..
>where i=somthing into cursor MyCursor
>
>Enddo
>
>I basicly need a way to APPEND to the cursor ...
>
>Many Thanks,
>Gadi Hutt
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform