Home » SQL & PL/SQL » SQL & PL/SQL » index & constraint (oracle 10g)
index & constraint [message #388461] Tue, 24 February 2009 23:12 Go to next message
rajasekhar857
Messages: 500
Registered: December 2008
Senior Member
hi,
can index name and constraint name can be same?is there any wrong in specifying the same?
Re: index & constraint [message #388462 is a reply to message #388461] Tue, 24 February 2009 23:14 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
When are you going to start following Posting Guidelines?
http://www.orafaq.com/forum/t/88153/0/


>can index name and constraint name can be same?
What do your tests show you?
Re: index & constraint [message #388463 is a reply to message #388462] Tue, 24 February 2009 23:16 Go to previous messageGo to next message
rajasekhar857
Messages: 500
Registered: December 2008
Senior Member
i am using a constraint like this

ALTER TABLE EMRPREVENTIVESCODESLKUP ADD (
CONSTRAINT PK_EMRPREVENTIVESCODESLKUP
PRIMARY KEY
(PREVENTIVE_SCODES_ID))
/

and giving index like this

CREATE UNIQUE INDEX PK_EMRPREVENTIVESCODESLKUP ON EMRPREVENTIVESCODESLKUP
(PREVENTIVE_SCODES_ID)
/

that is what i am asking
Re: index & constraint [message #388464 is a reply to message #388461] Tue, 24 February 2009 23:16 Go to previous messageGo to next message
aviva4500
Messages: 122
Registered: July 2008
Location: bangalore
Senior Member
@Rajasekar,
My recommend would be,you can place different names.



Regards,
Hammer
Re: index & constraint [message #388466 is a reply to message #388464] Tue, 24 February 2009 23:45 Go to previous messageGo to next message
trivendra
Messages: 211
Registered: October 2007
Location: Phoenix
Senior Member
Question and answer in same post of your own

Quote:
ALTER TABLE EMRPREVENTIVESCODESLKUP ADD (
CONSTRAINT PK_EMRPREVENTIVESCODESLKUP
PRIMARY KEY
(PREVENTIVE_SCODES_ID))
/

and giving index like this

CREATE UNIQUE INDEX PK_EMRPREVENTIVESCODESLKUP ON EMRPREVENTIVESCODESLKUP
(PREVENTIVE_SCODES_ID)
/


Thanks
Trivendra
Re: index & constraint [message #388574 is a reply to message #388463] Wed, 25 February 2009 08:13 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Why would you do something like this?

Creating a primary key would either create a unique index or use an already existing index. Oracle will not allow you to do this, which a simple test would have shown you.
Previous Topic: please help?
Next Topic: Query to know the last 5 querys laucnhed (merged)
Goto Forum:
  


Current Time: Fri Dec 06 18:25:22 CST 2024