I've got two identical tables of names and addresses called OldCombined and NewMASTER.
Both of these tables were dBase flat files that I dragged into a new HSQL format using OO3.3
While converting them I allowed OO to add a column called ID to the beginning of each table and make it the Primary key. It was then filled automatically with incrementing numbers.
Now I want to bring a select set of records from the old table to the new table, it should be simple right?
Here is what I've tried.
Code: Select all
INSERT INTO "NewMASTER" ("BUS_NAME", "ADDRESS", "SUITE", "CITY", "PROVINCE", "POSTAL_COD", "PRI_SIC", "PSIC_DESC", "INFOUSAID")
SELECT "BUS_NAME", "ADDRESS", "SUITE", "CITY", "PROVINCE", "POSTAL_COD", "PRI_SIC", "PSIC_DESC", "INFOUSAID"
FROM "OldCombined"
WHERE "OldCombined"."PRI_SIC" = 762923
I can run the last half and it will return the records I want"The data content could not be loaded" "Statement does not generate a result set"
Code: Select all
SELECT "BUS_NAME", "ADDRESS", "SUITE", "CITY", "PROVINCE", "POSTAL_COD", "PRI_SIC", "PSIC_DESC", "INFOUSAID"
FROM "OldCombined"
WHERE "OldCombined"."PRI_SIC" = 762923
I've checked the table NewMASTER and the ID field is integer. The table shows an index called SYS_IDX_46 on the ID field and is selected as 'unique"
I'm pretty sure it's a primary key problem. I obviously can't copy the whole record because the ID values are duplicates and will cause a conflict, I went to the table definition and set the ID field to autovalue hoping that new numbers would be written into the ID field based on the last number used when the table was created.
I thought that if I inserted every field except that ID field that it would work but no luck!
Any ideas out there?