copy data from one record of table to other records!

copy data from one record of table to other records!

Post by QnJpYW4gQ2 » Sat, 28 Feb 2004 09:26:08


Hello

This is brian. I'm here to ask whether any of you know how to copy the first record data to other records
This is an example
Table name: tabl
column: custno custnam custgender custfax custtel custad
A0001 BRIAN M 2360504 2360509 stewart st, Ottaw
2360555 gloucester st
2360888 kent st
2390828 somerset st

If I'm going to copy the first four column's data (A0001 BRIAN M 2360504) to the other three records. I truly know this is not a good way to do this, but please help, thanks

Brian.
 
 
 

copy data from one record of table to other records!

Post by David Fran » Sat, 28 Feb 2004 09:46:58

Brian,

you are right, this is not a good thing todo!

here's one way...

locate for custno = 'A0001'
scatter name oData fields custno, custnam, custgender, custfax
skip
scan rest
gather name oData
endscan

you should exercise great caution, because it's going to be very easy to
clobber data doing this.

--
df - Microsoft MVP FoxPro http://www.yqcomputer.com/




first record data to other records.
custtel custadd
2360509 stewart st, Ottawa
2360555 gloucester st.
2360888 kent st.
2390828 somerset st.
2360504) to the other three records. I truly know this is not a good way to
do this, but please help, thanks.

 
 
 

copy data from one record of table to other records!

Post by QnJpYW4gQ2 » Sat, 28 Feb 2004 11:16:06

Thanks for your idea

What if I'm not going to hardcode "locate for custno = 'A0001'", or I wanna choose the first record of the column 'custno'
The record ('A0001' BRIAN M ...) is located at the first record of the grid window

And what 'oData' refers to? Table name

Many thanks
Sam





Brian

you are right, this is not a good thing todo

here's one way..

locate for custno = 'A0001
scatter name oData fields custno, custnam, custgender, custfa
ski
scan res
gather name oDat
endsca

you should exercise great caution, because it's going to be very easy t
clobber data doing this

--
df - Microsoft MVP FoxPro http://www.yqcomputer.com/


"Brian Chang" < XXXX@XXXXX.COM > wrote in messag

> Hello
>> This is brian. I'm here to ask whether any of you know how to copy th
first record data to other records
> This is an example
> Table name: tabl
> column: custno custnam custgender custfa
custtel custad
> A0001 BRIAN M 236050
2360509 stewart st, Ottaw

2360555 gloucester st

2360888 kent st

2390828 somerset st
>> If I'm going to copy the first four column's data (A0001 BRIAN
2360504) to the other three records. I truly know this is not a good way t
do this, but please help, thanks
>> Brian
 
 
 

copy data from one record of table to other records!

Post by Anders Alt » Sat, 28 Feb 2004 20:20:40

Brian
Look up SET CARRY TO .. in Help, asd an alternative.
-Anders



first record data to other records.
custtel custadd
2360509 stewart st, Ottawa
2360555 gloucester st.
2360888 kent st.
2390828 somerset st.
2360504) to the other three records. I truly know this is not a good way to
do this, but please help, thanks.
 
 
 

copy data from one record of table to other records!

Post by David Fran » Sun, 29 Feb 2004 00:11:04

Sam,

SCATTER NAME oData - will create an object named oData which will have a
property for each field of the table and assign them values for the
currently selected row in the table.

--
df - Microsoft MVP FoxPro http://www.yqcomputer.com/



wanna choose the first record of the column 'custno'?
the grid window.