Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'Dynamic' SQL
Message
From
23/01/2001 08:10:01
 
 
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:
00467207
Views:
14
sorry, the previous message was missing some code.

lnResult = 1

*-- first, create individual result sets
DO WHILE MyCondition

lcResult = "Step" + PADL(lnResult, 6, "0")

DIMENSION laResult[lnResult]
laResult[lnResult] = lcResult

lnResult = lnResult + 1

SELECT whatever FROM whatever INTO CURSOR (lcResult)

ENDDO

SELECT (laResult[1]) && select first result set
USE DBF() AGAIN IN 0 ALIAS "FinalResult" && reopen cursor in read-write mode
SELECT FinalResult

*-- 'assemble' result sets into one cursor
FOR i = 2 TO ALEN(laResult, 1)
APPEND FROM DBF(laResult[i])
USE IN (laResult[i]) && close temp. result set
ENDFOR
Daniel
Previous
Reply
Map
View

Click here to load this message in the networking platform