Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COPY TO ARRAY against a cursor?
Message
From
01/08/2019 19:22:16
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
COPY TO ARRAY against a cursor?
Miscellaneous
Thread ID:
01669872
Message ID:
01669872
Views:
104
All,

I'm seeing issues with COPY TO ARRAY. The following illustrates it on my machine today:
create cursor ffff (g_ggx c(1))
insert into ffff values ("A")
insert into ffff values ("B")
insert into ffff values ("C")
insert into ffff values ("D")
insert into ffff values ("E")
declare laTest(50,1)
laTest=""
COPY TO  laTest FIELDS g_ggx
SET STEP ON
Looking at laTest content in Debug, first 5 rows ought to be populated with field content- but nix. HELP refers to Tables as source for COPY TO ARRAY and there's no mention of Cursors, but SCATTER to ARRAY from a cursor works beautifully and I'd expected COPY TO would too.

Issue is that I want that array size to be maintained with blank rows for the surplus. The other option is SELECT into ARRAY, but Tamar's paper calls that an order of magnitude slower for a small resultset and it also truncates the array- which breaks the intended model.

Any advice appreciated! I've experimented with NOOPTIMIZE and FOR .T. as well as large cursors that ought to spool to disk (in case it's the memory-residency that's the cause) but it reproducibly refuses to populate the array from a cursor....
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Next
Reply
Map
View

Click here to load this message in the networking platform