Re: How to duplicate a record easely


Florian Groothuis
 

Or

 

INSERT INTO TABLE A

SELECT *

FROM TABLE A

WHERE ...

 

but I was just wondering:

 

-       why do you want to duplicate a record?

-       isn’t there a unique key to prevent this?

 

 

 

 

Van: main@magicu-l.groups.io [mailto:main@magicu-l.groups.io] Namens Jakes du Preez
Verzonden: woensdag 26 juli 2017 12:51
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] How to duplicate a record easely

 

You can use a sql script with this format:

 

insert into my_source_table

select col1, col2, col3,...

from my_source_table

where some_conditions_true

 

... just remember not to break any uniqueness rules, i.e. replace the column values for those columns that make up unique indexes. Also remember (in the select statement) to define your columns in the same order that they are defined in for the table.

 

In Magic you can write a batch program that will range on the table then, in the same task, do a Link Create on the table

 

On Wed, Jul 26, 2017 at 12:13 PM, <gac@...> wrote:

Hello,

I want duplicate a record in the same table and in the same DB.

Thank for your response.

Best regards

 

Met vriendelijke groet - With kind regards,

Florian Groothuis
Analist/programmeur
+31 (0)6 21927914


meilink.eu

Meilink Beheer Borculo B.V. • Kamerlingh Onnesstraat 1
7271 AZ  Borculo • Nederland • +31 (0)545 253525
KvK 08009803 • Our general terms and conditions apply • Disclaimer


Join main@magicu-l.groups.io to automatically receive all group messages.