constraints

All posts relating to Oracle database administration.

Moderator: Tim...

constraints

Postby Guest » Mon Nov 01, 2004 6:09 pm

hi
if we disable a primary key constraint and we have invalid values in primary key column and then we enable it no validate then oracle returns an error...and oracle says that if u have nonunique index on ur primary key column then u can enable constraint novalidate....kindly someone tell me that how can we create a nonunique constraint explicitely because i didnt see syntax for this anywhere
Regards
Guest
 

RE:constraints

Postby Tim... » Mon Nov 01, 2004 6:09 pm

Hi.

You need to drop the primary key, create a non-unique index on the table, then create the primary key telling it o use the non-unique index, then you disable no-validate it.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17970
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

RE:constraints

Postby Guest » Mon Nov 01, 2004 6:09 pm

hi
well these things i already know, the question was that how to create non-unique index???is it the case that whn we create an index on a non key columns, it is non unique or is there some command that we use to creae a nonunique index
Regards
Guest
 

RE:constraints

Postby Tim... » Mon Nov 01, 2004 6:09 pm

Hi.

CREATE INDEX ....
CREATE UNIQUE INDEX ....

Simple as that.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17970
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK


Return to Oracle Database Administration

Who is online

Users browsing this forum: No registered users and 3 guests