Home » RDBMS Server » Server Administration » enable constraint (9i)
enable constraint [message #328929] Mon, 23 June 2008 07:30 Go to next message
mandygrewalindia
Messages: 14
Registered: February 2008
Location: india
Junior Member
hi I have unique key constraint on deptno of dept table which is disabled to insert duplicate values.
I need to enable constrain through enable novalidate n then make exceptions table ... however status in dba_constaints shows unique constraint disabled but wen i try to fire this command:
alter table scott.dept enable novalidate constraint unique_dept;
it shows error ORA-02299 i.e deplicate keys found....
please help...
Re: enable constraint [message #328931 is a reply to message #328929] Mon, 23 June 2008 07:47 Go to previous messageGo to next message
msriram123
Messages: 11
Registered: May 2008
Location: Hyderabad
Junior Member
Looks like multiple rows with the same deptno were inserted into your table while the constraint was disabled.

Before you enable the unique constraint, you need to somehow make sure that no deptno ever repeats in the table.
Re: enable constraint [message #328932 is a reply to message #328929] Mon, 23 June 2008 07:47 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Create your exception table and enable the constraint, you don't need this step to novalidate.

Regards
Michel
Re: enable constraint [message #328933 is a reply to message #328931] Mon, 23 June 2008 07:54 Go to previous messageGo to next message
msriram123
Messages: 11
Registered: May 2008
Location: Hyderabad
Junior Member
Sorry... just ignore my prevous reply. I replied before reading your post fully... apologies
Re: enable constraint [message #328939 is a reply to message #328932] Mon, 23 June 2008 08:14 Go to previous message
mandygrewalindia
Messages: 14
Registered: February 2008
Location: india
Junior Member
thankx it worked.
Previous Topic: Database creation
Next Topic: to kill a session
Goto Forum:
  


Current Time: Sat Dec 10 04:55:54 CST 2016

Total time taken to generate the page: 0.09132 seconds