Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Constraints
Walter,
This is redundant. And furthermore, it's not possible. You can not add a unique constraint to a column that is already defined as a primary key. For example:
SQL> create table test (id number primary key);
Table created.
SQL> alter table test add constraint id_uq unique (id)
*
HTH,
Brian
Walter T Rejuney wrote:
>
> Is it considered redundant to have a primary key, unique constraint and
> a not null constraint all on the same column or is it considered a good
> practice to define all three even though the primary key constraint
> effectively enforces both not-null and unique constraints?
-- ======================================== Brian Peasland Raytheons Systems at USGS EROS Data Center These opinions are my own and do not necessarily reflect the opinions of my company! ========================================Received on Tue Jul 11 2000 - 00:00:00 CDT