Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

recreating a constraint

LostInPermuationsFeb 4 2016 — edited Feb 5 2016

I finally got the business to buy into letting me replace columns that were created years and years ago using Oracle reserved words.

Not being  as simple as just changing a column, there were constraints and indexes to be modified as well.

Here is my problem.  I dropped the constraint, and when I try to recreate it with the newly renamed column, it's throwing:

ORA-00955: name is already used by an existing object

Here is the syntax that I'm running:

ALTER TABLE FS_NRIS_NVUM.NRN_MARKET_AREAS

  DROP CONSTRAINT NRN_MARKET_AREAS_UK;

ALTER TABLE FS_NRIS_NVUM.NRN_MARKET_AREAS ADD (

  CONSTRAINT NRN_MARKET_AREAS_UK

  UNIQUE (AFOREST_CODE, SUBUNIT, SURVEY_ROUND, AREAKEY)

  ENABLE VALIDATE);

Why won't it allow me add the constraint back?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 4 2016
Added on Feb 4 2016
7 comments
932 views