Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'Dynamic' SQL
Message
From
23/01/2001 08:02:27
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
23/01/2001 07:11:42
Gad Hutt
Express Print
Herzliya, Israel
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00467190
Message ID:
00467202
Views:
15
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
Previous
Reply
Map
View

Click here to load this message in the networking platform