Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Copy a single record within a table.

Posted on 1997-04-08
3
Medium Priority
?
161 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

715 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