When trying to add data from one table to another I keep getting the same error message: SQL> INSERT INTO BoatBookingMain(Week, BoatName) 2 SELECT DISTINCT Week, BoatName 3 FROM jco.BoatBooking; INSERT INTO BoatBookingMain(Week, BoatName) * ERROR at line 1: ORA-00001: unique constraint (SPARE12.PK_BOATBOOKINGMAIN) violated. What am I doing wrong? I am new to all of this!
The ORA-00001 error is telling you that an integrity constraint is being violated by your action. As such, your action is not allowed. The integrity constraint in this case ensures that all values in a specific column(s) are guaranteed to be unique. The constraint that is being violated is the SPARE12.PK_BOATBOOKINGMAIN constraint. To see the column(s) affected by this constraint, you can issue the following query:
In order for your INSERT statement to succeed, you must ensure that you have not inserted duplicate column values into the columns returned from the above query.