Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Row id

Status
Not open for further replies.

joshuaguilty

Programmer
Apr 26, 2005
81
CA
I have a large table, which I need to modify some of the fields, with heavy use. Therefore I made a copy of it. My question is I want to modify the copy and then match them once I finish based on their corresponding row id.
Any one could help !?
Thanks.
 
Joshuaguilty,
If you are doing this while no one else is using the table, then there is no need to update your old table... if you're doing this because you want users to be able to continue to make changes to the table, you need to consider 2 things.

1) Will users be editing any of the records that you will be changing? If so, it's best not to do this off-line, but within your application that the table is created with.

2) Will users be adding new records ONLY to the table?

If 2 is the case, then your life is easy. Once you have made your changes, simply open the two tables in work areas. Then append from the table that your users were adding to onto your table. It would look something like this:
First, make sure everyone is out of the system, and all tables are closed. Then:

SELECT 0
USE MyEditedTable EXCL

SELECT 0
USU ExistingTable EXCL

SELECT MyEditedTable
APPEND FROM MyExistingTable where RECNO(MyExistingTable) > RECCOUNT(MyEditedTable)

Then your new "MyEditedTable" has all the records. Rename this table to the proper name, and you're done.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
A question. What does it mean by "c_Added" in "INTO CURSOR c_Added" ?
I am a new guy to old Fox Pro.
I have two tables (one original and one copy-to-do-edit) which they are the same. (original table is just for appending)
Source1
Field1 Field2
AAA 111
BBB 222
CCC 333
Target1
AAA 123
BBB 222
CCC 333
Based on row-id I would like to modify "AAA" on "Source1" from "111" to "123".

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top