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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: PK Violation on insert

RE: PK Violation on insert

From: Shahid Malik(IT) <shahid.malik_at_pepsi-lahore.com.pk>
Date: Fri, 07 Sep 2001 06:02:31 -0700
Message-ID: <F001.003866ED.20010907052627@fatcity.com>

you can find the duplicate records which vilate primary key with this sql

select count(*) from table name
group by
DODAAC,
NSN,
CONTRACT
having
count(*)>1

Shahid Malik.

-----Original Message-----
Sent: Friday, September 07, 2001 5:41 PM To: Multiple recipients of list ORACLE-L

Good Morning,

I am selecting information from 3 tables and inserting it into a new table. My compound primary key is composed of:

  DODAAC       VARCHAR2(6)
  NSN              VARCHAR2(13)

  CONTRACT VARCHAR2(14) The results BEFORE I put the PK on the INSERT resulted in about 650,000 records. After I put the PK in I am getting: ORA-00001: unique constraint (SHOPPINGSA.SCAN_CONTRACT_PK) violated

How do I find the bad data ???

TIA Al Rusnak
804-734-8453
rusnakga_at_hqlee.deca.mil
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Rusnak, George A.
  INET: rusnakga_at_hqlee.deca.mil

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Shahid Malik(IT)
  INET: shahid.malik_at_pepsi-lahore.com.pk
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri Sep 07 2001 - 08:02:31 CDT

Original text of this message

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