Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select and append
Message
From
01/09/2008 16:21:17
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
 
To
31/08/2008 05:25:54
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01343606
Message ID:
01343898
Views:
19
To copy rows that match between a Source table and a Target Table table, check out the APPEND FROM command. If the tables don't match or one or both of the tables is actually a cursor you can do this:
sele SourceTable
scan
  scatter name oFields
  insert into TargetTable from name oFields
endscan
This will populate fields in TargetTable that match the fields in SourceTable.

If you need to create a new table to match only the fields in SourceTable, check out the AFIELDS() function combined with CREATE CURSOR FROM ARRAY/CREATE TABLE FROM ARRAY commands.
"... 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
Previous
Reply
Map
View

Click here to load this message in the networking platform