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!

Naming conflict (ORA-00955) for index and constraint when using unique index (.. desc, .. asc)

Giovanni_66Dec 11 2013 — edited Dec 11 2013

Hello,

indexes and constraints are in different namespaces, therefore it should be possible to assign them the same name.

In the following case this is apparently not working:

create unique index orders_year_show_uq
  on orders (year desc, show_orders asc);

alter table orders
  add constraint orders_year_show_uq unique (year, show_order);

When I execute these statement, I get an "SQL Error: ORA-00955: name is already used by an existing object".

If I clean up and I execute the same statements as above with the only difference on line 2, using "year asc" instead of "year desc":


  on orders (year asc, show_orders asc);

then it successes.

I cannot explain it, do you have any idea?

Thanks in advance.

Kind regards

Giovanni

This post has been answered by Solomon Yakobson on Dec 11 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 8 2014
Added on Dec 11 2013
3 comments
905 views