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: Urgent-ORA0001 Unique COnstraint

RE: Urgent-ORA0001 Unique COnstraint

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Tue, 6 Mar 2007 14:53:33 -0800
Message-ID: <22EC50E60931494FA666A8CF8260C45B5D9C6F@ALVMBXW05.prod.quest.corp>


Well, the error message should give you the name of the constraint or index causing the problem: ORA-00001: unique constraint (OWNER.NAME) violated OWNER = index or constraint owner
NAME = index or constraint name  

If you don't get the full error message, look for unique indexes / constraints on the table:  

select a.owner, a.constraint_name, a.constraint_type, b.column_name  from dba_constraints a, dba_cons_columns b  where
   a.owner = '&table_owner'

   and a.table_name = '&table_name'
   and a.constraint_type in ('P', 'U')
   and b.owner = a.owner
   and b.constraint_name = a.constraint_name
 order by a.owner, a.constraint_name, b.position ; select a.owner, a.index_name, a.index_type, b.column_name  from dba_indexes a, dba_ind_columns b
 where
   a.table_owner = '&table_owner'
   and a.table_name = '&table_name'
   and a.uniqueness = 'UNIQUE'
   and b.index_owner = a.owner
   and b.index_name = a.index_name

 order by a.owner, a.index_name, b.column_position ;

If that still doesn't solve the problem, then you need to start looking at triggers on the table to see if they are causing the error.  


De : oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] De la part de Sanjay Mishra Envoyé : mardi, 6. mars 2007 11:50
À : oracle-l_at_freelists.org
Objet : Urgent-ORA0001 Unique COnstraint

Hi  

I had to load some big data into the table and it has a composite Primary Key. I had disabled the Primary Key and when trying to insert the data, it is still failing with the Constraint violation  

Thanks


Don't get soaked. Take a quick peek at the forecast <http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news> with theYahoo! Search weather shortcut. <http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&#news>

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Mar 06 2007 - 16:53:33 CST

Original text of this message

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