Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy record from one table to another
Message
From
26/06/2002 10:49:16
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00672054
Message ID:
00672472
Views:
8
Steve,
Are you using FoxPro tables or are you connecting to something like SQL Server?
If you are using FoxPro tables:
I agree with the SCATTER/GATHER method, but your field names are not the same.

If you are using non-FoxPro tables AND there is a unique key:
I believe that you must use the Insert statement.

--------------------------------------------------------------------
select vehicle_arc
SELECT * from lv_veh WHERE lv_veh.v_id = .a INTO TABLE tt_vehicle_arc
select tt_vehicle_arc
scan
insert into vehicle_arc fields(f1,f2,f3);
values(tt_vehicle.f1,tt_vehicle.f2,tt_vehicle.f3)
endscan
* this method may be slower because you are touching each record yourself.
--------------------------------------------------------------------

Another method would be to copy the data to a .csv and append the data.
select vehicle_arc
copy to tt_vehicle_arc type csv for "where clause"
select lv_veh
append from tt_vehicle_arc

Good luck,
Mike
Previous
Reply
Map
View

Click here to load this message in the networking platform