RE: Urgent-ORA0001 Unique COnstraint

  • From: "Jacques Kilchoer" <Jacques.Kilchoer@xxxxxxxxx>
  • To: <smishra_97@xxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 6 Mar 2007 14:53:33 -0800

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@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] De la 
part de Sanjay Mishra
Envoyé : mardi, 6. mars 2007 11:50
À : oracle-l@xxxxxxxxxxxxx
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> 


Other related posts: