Home » SQL & PL/SQL » SQL & PL/SQL » Can we rename a constraint
Can we rename a constraint [message #320507] Thu, 15 May 2008 05:41 Go to next message
manoj12
Messages: 210
Registered: March 2008
Location: India
Senior Member
Dear Sir

When we create a table with columns having constraints for eg

create table xyz(x number(10) not null,y number);

when we use this command the table is created with x column having not null constraints and the constraint name appears to be default name like this SYS_CO053288.Can we rename the name of the constraint from SYS-O053288 TO NN_XYZ_ABC after creating the table?.If we can rename the name of the constraints how we can do?.
Regards

[Updated on: Thu, 15 May 2008 05:42]

Report message to a moderator

Re: Can we rename a constraint [message #320508 is a reply to message #320507] Thu, 15 May 2008 05:44 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

ALTER TABLE xyz RENAME CONSTRAINT SYS_O053288 TO NN_XYZ_ABC
Re: Can we rename a constraint [message #320509 is a reply to message #320507] Thu, 15 May 2008 05:44 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
alter table ... rename constraint ... to ...

Regards
Michel
Re: Can we rename a constraint [message #320512 is a reply to message #320507] Thu, 15 May 2008 05:46 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
Search is a good facility and it could be used before posting on the forums.

http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#i2133183

Regards

Raj

P.S : @Michael, I am too slow in typing Cool

[Updated on: Thu, 15 May 2008 05:47]

Report message to a moderator

Re: Can we rename a constraint [message #320513 is a reply to message #320509] Thu, 15 May 2008 05:46 Go to previous message
manoj12
Messages: 210
Registered: March 2008
Location: India
Senior Member
Dear Sir

Thank you very much.

Regards
Previous Topic: Tunning of SQL,it fetches more than one lakh rows
Next Topic: limit in forall colect
Goto Forum:
  


Current Time: Tue Dec 03 15:28:30 CST 2024