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