I have a two tables one with 4265 records and another with 670 records that are setup identically but with different data. The first table has a primary key. So when I try to copy the data from one table to the other I get a duplicate key error.
So I'm trying to do an insert statement that will take all the data except the primary key and place it into the other table. Then in place of the primary key I want to insert an incremental number starting with 4266. The name of the primary key column is PLUKID. So far this is what I have minus the part with the incremental value.
INSERT INTO CRPDTA.F4305 (PLLOGH, PLDOCO, PLKCOO, PLSFXO, PLAN8, PLMCU, PLOMCU, PLLGTY, PLLGNO, PLDL01, PLSTSC)
SELECT PLLOGH, PLDOCO, PLKCOO, PLSFXO, PLAN8, PLMCU, PLOMCU, PLLGTY, PLLGNO, PLDL01, PLSTSC
FROM CRPDTA.F4305_013007
So I'm trying to do an insert statement that will take all the data except the primary key and place it into the other table. Then in place of the primary key I want to insert an incremental number starting with 4266. The name of the primary key column is PLUKID. So far this is what I have minus the part with the incremental value.
INSERT INTO CRPDTA.F4305 (PLLOGH, PLDOCO, PLKCOO, PLSFXO, PLAN8, PLMCU, PLOMCU, PLLGTY, PLLGNO, PLDL01, PLSTSC)
SELECT PLLOGH, PLDOCO, PLKCOO, PLSFXO, PLAN8, PLMCU, PLOMCU, PLLGTY, PLLGNO, PLDL01, PLSTSC
FROM CRPDTA.F4305_013007