[ic] Copying field to field for all product records

Morrie Wyatt interchange-users@icdevgroup.org
Fri Jun 28 12:31:02 2002


On Sat, 2002-06-29 at 01:56, Jim Toro wrote:
> 
> 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.
> 

Under PostgreSQL or MySQL:

update table
set table.field23 = table.field4, table.field24 = table.field5
;

Changing table and fieldxx to match the appropriate names used
in the database, and entered via psql or mysql.

That should do the job you require.

Regards,
Morrie.