1 Reply Latest reply on Nov 12, 2013 9:11 AM by Jim Smith

    primary keys duplication


      I want to import these data to the sqldeveloper:


      Project NameStreet NameTypePostalMarketTenureNo. ofPriceAreaType ofFloor LevelUnit PriceDate of Option
      THE ROCHESTERROCHESTER DRIVEApartment5RCR99 yrs lease commencing from 200511260000861Strata06 to 101463Sep-13
      THE ROCHESTERROCHESTER DRIVEApartment5RCR99 yrs lease commencing from 200511260000861Strata11 to 201966Sep-13
      MERAPRIMEJALAN BUKIT HO SWEECondominium3RCR99 yrs lease commencing from 2003119000001313Strata26 to 301447Sep-13
      PEARL BANK APARTMENTPEARL BANKApartment3RCR99 yrs lease commencing from 1970115200001755Strata16 to 20866Sep-13


      I used a trigger and sequence for auto-generate primary keys, but for the first 2, they have the same project name, different details.

      I want them to have the same primary key, how do I go about it? :/

        • 1. Re: primary keys duplication
          Jim Smith

          This isn't really a SQL Developer question.  Try asking in the SQL and PL/SQL forum.


          By definition, no two records can have the same primary key.  That is what primary key means.


          It first glance, looks like the natural key for these records would be a combination of project name  and floor level .


          What would happen if you wanted to increase the price at the Rochester on the upper floors but not the lower floors?