Newbies roduenas Posted March 25, 2009 Newbies Posted March 25, 2009 (edited) I would like to duplicate the data in a field to a different field for a found set of records. Is there a way to do this besides copying and pasting the data one record at a time? The field needs to remain editable, and the copy/paste can effect only the found set of records. Edited March 25, 2009 by Guest
comment Posted March 25, 2009 Posted March 25, 2009 Replace Field Contents can do this, but - are you sure you really need to do this? Note that this (or any other method) can fail if some of the records happen to be locked by other users.
LaRetta Posted March 25, 2009 Posted March 25, 2009 duplicate the data in a field to a different field for a found set of records. Find the record with the field data you want to duplicate. Place your cursor in the field then run your script of: Set Variable [ $fieldData ; YourTable::YourField ] ... perform the find to isolate your found set Replace Field Contents [ by calculation ; newField ; $fieldData ] Back up first. And remember to trap for record locking if the file is being served, ie: Set Error Capture [ On ] Replace Field Contents [ bla bla ] If Get ( LastError ) ... or If ( Get ( LastError ) = 201
LaRetta Posted March 25, 2009 Posted March 25, 2009 You beat me!! I must be losing my edge!! :laugh2:
comment Posted March 25, 2009 Posted March 25, 2009 It's easy when one is - what's the word? - ah, yes: concise. : But I thought they wanted to duplicate the data "internally" in each record: Replace Field Contents [ Table::Targetfield ; Table::Sourcefield ]
LaRetta Posted March 26, 2009 Posted March 26, 2009 (edited) Oh. <--- uber concise (true, not nearly as good a comeback)! Oh wait! Mine offers depth! It looks like I misunderstood their need. Then the request implies data shuffling and I would wonder why the need has arisen. Roduenas? Is this a one-time cleanup issue or is it an ongoing process? If strictly for cleanup then sometimes we do what we need to do; if for on-going process, I would question why it is needed. Every time you move data - whether from one field to another; whether from one record or one table to another; whether importing, pushing ... it all indicates manipulation which can break in the middle of a script with power outage, User performing 3-finger-salute etc. The least you touch data the better you are. Edited March 26, 2009 by Guest
comment Posted March 26, 2009 Posted March 26, 2009 It looks like I misunderstood their need. Or I did. Either way, some clarifications would be useful - esp. regarding the purpose.
Recommended Posts
This topic is 5780 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now