Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 162
  • Last Modified:

Copy a single record within a table.

I need to duplicate a record in a Paradox table (with the exception of two fields - there are 30 fields total!.  Obviously the brute force method is to create 30 temp vars to hold the record to copy and then do an Insert and copy the 30 vars to the new record....Is there a more elegant solution ?  One idea - is it possible to disable the automatic clearing of all fields when an insert is performed ?
0
Mike Strauser
Asked:
Mike Strauser
  • 2
1 Solution
 
javiertbCommented:
Try using TBatchMove component.
0
 
Mike StrauserAuthor Commented:
Since this is an indexed table and the source and destination are the same table, this would seem to result in a key violation error....and no record is transferred (copied).
0
 
javiertbCommented:
What about copying the record with TBatchMove to another temporary table, modify the two fields there (I suppose they are the index fields) and then copy this record from the temp table to the final location.  As for your question about not clearing the fields on inserting a new record, the only thing you can do is to use BeforeInsert table event to fill the fields with whatever contents you want (contents not from the same table).
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now