Home » Developer & Programmer » Forms » ORA-00001: unique constraint
ORA-00001: unique constraint [message #499617] Tue, 15 March 2011 08:55 Go to next message
piyarustagi
Messages: 38
Registered: January 2011
Member
I have disabled the primary key on a table using this...
ALTER TABLE C_LOV_BOROUGH DISABLE CONSTRAINT CLOVBOROUGH_PK CASCADE;

but now when I try to insert duplicate value. It gives this error.

ORA-00001: unique constraint (LOT_DBA.CLOVBOROUGH_PK) violated

please help..
Re: ORA-00001: unique constraint [message #499619 is a reply to message #499617] Tue, 15 March 2011 09:03 Go to previous messageGo to next message
Michel Cadot
Messages: 68684
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Remove the duplicates.

Regards
Michel
Re: ORA-00001: unique constraint [message #499620 is a reply to message #499619] Tue, 15 March 2011 09:06 Go to previous messageGo to next message
piyarustagi
Messages: 38
Registered: January 2011
Member
For some requirement ... I need to insert the duplicates , that's why I disabled primary key.
Re: ORA-00001: unique constraint [message #499623 is a reply to message #499620] Tue, 15 March 2011 09:27 Go to previous messageGo to next message
Michel Cadot
Messages: 68684
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You have to choose one of these options and only one:
- Remove the duplicates
- Remove the primary key (or let it disable)
- Change the primary key columns in order to have no duplicate with them

Regards
Michel

[Updated on: Tue, 15 March 2011 09:27]

Report message to a moderator

Re: ORA-00001: unique constraint [message #500017 is a reply to message #499623] Thu, 17 March 2011 04:39 Go to previous messageGo to next message
Manoj.Gupta.91
Messages: 239
Registered: March 2008
Location: Delhi
Senior Member
Hi,

@Michel Cadot

He has DISABLED that constraint and still he is not able to insert duplicates.

After disabling primary key he should be able to insert duplicates. He has done something wrong or may be that constraint is not disabled.

Hi piyarustagi,

Check in USER_CONSTRAINTS data disctionary. Is that constraint actually disabled or not?

Is unique index dropped or not? After disabling primary key unique index must be dropped if you are not using KEEP INDEX option.

Regards
Manoj

Re: ORA-00001: unique constraint [message #500062 is a reply to message #499617] Thu, 17 March 2011 09:42 Go to previous message
piyarustagi
Messages: 38
Registered: January 2011
Member
you are right...I dropped the index and now it's fine.
Thanks a lot.
Previous Topic: Calling Procedure at (Form, Library and Database) level
Next Topic: How to show long type data in editor
Goto Forum:
  


Current Time: Tue Sep 17 05:03:40 CDT 2024