Solved

Copy a single record within a table.

Posted on 1997-04-08
3
156 Views
Last Modified: 2010-04-04
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
Comment
Question by:Mike Strauser
  • 2
3 Comments
 
LVL 2

Expert Comment

by:javiertb
ID: 1335254
Try using TBatchMove component.
0
 

Author Comment

by:Mike Strauser
ID: 1335255
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
 
LVL 2

Accepted Solution

by:
javiertb earned 100 total points
ID: 1335256
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to use Hashing sha1 in Delphi 2010 4 260
Internet Explorer View Settings Question 15 111
FMX enumerated colours 2 98
Press three keys together and trigger a function 3 55
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question