[ic] Copying field to field for all product records

Ron Phipps interchange-users@icdevgroup.org
Fri Jun 28 12:29:01 2002


> From: Jim Toro
> 
> I got a products database of 30,000 records. It was specially designed
> with all new empty fields for future growth needs. Now the customer
> wants two fields of each record to be copied to two currently empty
> fields of the same record, for each record of the database. So that
> the exiting data fields are duplicated in the new fields.
> 
> This is a one-shot job, just taking "field4" and "field5" and copying
> their data to "field23" and "field24", all 30,000 records.
> 
> Anyone know of a quick way to do it. I could export the data and
> manipulate it and then reimport it but I was wondering if some tool or
> existing routine might do it so I dont have to re-invent the wheel.

If you are running a SQL backend like MySQL or PostgreSQL you can do the
following in your SQL tool:

UPDATE products
SET field23 = field4, field24 = field5

Make sure you backup the table before running this command in case it
does not do what you want.

-Ron