ORA-00001: unique constraint Violation [message #275967] |
Tue, 23 October 2007 09:16  |
balamurugan.murthy
Messages: 21 Registered: October 2007
|
Junior Member |
|
|
Friends,
when i try to insert a row into a table the following error is thrown:
" ORA-00001: unique constraint (TESTADMIN.SYS_C001686) violated ".
The rows inserted into the destination table is being fetched from another table and the row is inserted into the
destination table.
I have checked the destination table for the duplicate values (checked with column assocaited with Index - SYS_C001686),
and 100% sure that there is no such unique key earlier to this current value,but still it throws this error.
I have a java screen and on a button click, it tries to insert the row in the destination table
and when it does it throws such error.
But when i tried to insert the same row using a direct insert statement in the DB, it got inserted without
any issues.
Can someone please help me on this strange behaviour and suggest anyway to overcome this ?
|
|
|
|
Re: ORA-00001: unique constraint Violation [message #275972 is a reply to message #275971] |
Tue, 23 October 2007 09:34   |
balamurugan.murthy
Messages: 21 Registered: October 2007
|
Junior Member |
|
|
Thanks for your quick reply.
But the problem is that it works fine without any issues 90% of the time. I get this error randomnly and if i
try the same after a day or so, it does work fine !!!!
So will it still be the coz of the parameters being passed by JAVA program or any issues with a corrupt INDEX..
Seek ur suggestions plz..
|
|
|
|
|
|
Re: ORA-00001: unique constraint Violation [message #276042 is a reply to message #276003] |
Tue, 23 October 2007 14:03   |
balamurugan.murthy
Messages: 21 Registered: October 2007
|
Junior Member |
|
|
Hi Michael,
There is no implicit conversion that takes place jus before inserting the data into the table. But i do have a decode function that decodes a value for one of the column value in the row that will be inserted. Will that cause any problem leading to ORA-00001: unique constraint Violation error ?
|
|
|
|
|
|
|
|
Re: ORA-00001: unique constraint Violation [message #276061 is a reply to message #275967] |
Tue, 23 October 2007 16:06   |
balamurugan.murthy
Messages: 21 Registered: October 2007
|
Junior Member |
|
|
But Kevin,
In reply to your statment:
"I suggest, you drop the unique constraint (this will drop the unique index at the same time), load the table with a dataset known to cause the error, and then find the duplicate row. This will prove to you that infact your are attempting to load duplicates."
--- Actually as per my previous update, i have tried inserting this record by issuing an insert query directly against the table and it gets inserted without any issues. The error is thrown only if i try to insert on a button click present in the front end java screen. On button click it fetches data from selected vlues on the screen and tries to insert into table and gets this error message thrown..
anyway i will try as per ur suggestion and get back to you.
Thanks,
Bala.
|
|
|
|
Re: ORA-00001: unique constraint Violation [message #276249 is a reply to message #275967] |
Wed, 24 October 2007 08:57   |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
Your statements are telling you where the error is. Oracle will NOT throw a ORA-00001 unless you are attempting to insert a duplicate row. You say that when you do the insert manually it always works, so there is only one possibility. The problem is with your application. Is it possible that people are double clicking the button and firing the insert logic twice? To combat this, clear the values after they are inserted.
|
|
|
Re: ORA-00001: unique constraint Violation [message #276334 is a reply to message #276249] |
Wed, 24 October 2007 21:51   |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
Have you checked in DBA_CON_COLUMNS to make sure that SYS_C001686 is the unique/PK constraint that you think it is. Or are you just assuming?
For example, it could be another unique index on the same table, or it could be on another table that you are populating with a TRIGGER on the first table.
Ross Leishman
|
|
|
|