Re: Primary key question

From: Charles Hooper <hooperc2000_at_yahoo.com>
Date: Wed, 13 Feb 2008 09:54:28 -0800 (PST)
Message-ID: <f9711d86-53b7-4b3d-ab62-4e68f91fb823@e6g2000prf.googlegroups.com>


On Feb 13, 9:22 am, "fitzjarr..._at_cox.net" <fitzjarr..._at_cox.net> wrote:
> SQL> create table abc(
>   2  a varchar2(8),
>   3  b varchar2(8),
>   4  c varchar2(8));
>
> Table created.
>
> SQL> create index abc_ind
>   2  on abc(a, b, c desc)
>   3  /
>
> Index created.
>
> SQL> alter table abc
>   2  add constraint abc_pk
>   3  primary key(a,b,c)
>   4  using index abc_ind;
> alter table abc
> *
> ERROR at line 1:
> ORA-14196: Specified index cannot be used to enforce the constraint.
>
> SQL>
>
> David Fitzjarrell

Nice example David - Oracle even provided a detailed error message with your tesr run.

Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. Received on Wed Feb 13 2008 - 11:54:28 CST

Original text of this message