Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: How do I locate duplicate rows

Re: How do I locate duplicate rows

From: Tom Leary <tleary1_at_uswest.net>
Date: Sat, 2 Dec 2000 17:22:04 -0800
Message-ID: <R9gW5.761$tR6.362063@news.uswest.net>

In the sysntax for creating the primary key, there is a clause which can give you the rowids of the offending rows-

alter table tblname add constraint pk_mytable primary key mytable(col1, col2)
exceptions into pk_exceptions;

pk_exceptions must already exist
create table pk_exceptions(table_name VARCHAR2(30), row_id ROWID);

HTH,
DBA Tom

"Anthony Valentine" <amv_at_sbsalaska.com> wrote in message news:3A25AD6E.9887FF22_at_sbsalaska.com...
> Hello All!
>
> I am trying to add a unique constraint to a table, but I get the
> following error:
>
> ORA-02299: cannot validate (ORACLE.LOS160MASTER_UK) - duplicate keys
> found
>
> Is there any way to get Oracle to tell me which rows contain the
> duplicate keys?
>
>
> Thanks in advance!
>
> Anthony Valentine
>
>
>
Received on Sat Dec 02 2000 - 19:22:04 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US