Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT into a array
Message
From
11/06/2004 13:44:01
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
SELECT into a array
Miscellaneous
Thread ID:
00912818
Message ID:
00912818
Views:
44
With the new possibilities of the Array, it comes natural,
if the memory is available, to use them in intensive way.
But the SELECT into Array however generate an intermediate cursor
and then they copy this in the Array.
CLEAR
SET DELETED OFF
CREATE CURSOR testCursor ( SSS V(254) NULL )
FOR K=1 TO 100000
  INSERT INTO (ALIAS()) VALUES (REPLICATE(CHR(RAND()*255),RAND()*240))
NEXT
? 'start'


T1=SECONDS()
FOR XX=1 TO 10
SELECT testCursor  
COPY TO ARRAY RESULT2
NEXT
? SECONDS() - T1,_tally

T1=SECONDS()
FOR XX=1 TO 10
SELECT SSS FROM testCursor  INTO CURSOR RESULT1
NEXT
? SECONDS() - T1,_tally

* next require 2 times respect a direct copy 
* bacuse it copy into a temp cursor and then into the array
T1=SECONDS()
FOR XX=1 TO 10
SELECT SSS FROM testCursor  INTO ARRAY RESULT1
NEXT
? SECONDS() - T1,_tally
For the SELECT with a result in an Array,
it is possible to skip the penultimate passage ?

Thanks
Next
Reply
Map
View

Click here to load this message in the networking platform