Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Renaming PK constraints, indexing existing tables
In article <3a5e4372.194400344_at_news.alt.net>,
SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK (Brian Tkatch)
wrote:
> >Uh oh. So... hmm... to rename these suckers I take it I'm going to
> >have to rebuild the tables with the appropriate constraint clause
with
> >a readable name, eh?
> >Rats.
> >
> I don't believe so. I have successfully renamed quite a few Primary
> Keys.
>
> ALTER TABLE Cow DROP C_Moo_PK;
> ALTER TABLE Cow ADD CONSTRAINT C1_Moo_PK PRIMARY KEY (Moo);
Yep - finally got that squared away. For some reason I was thinking column constraints, not table constraints. Once I got that mental blockage cleared it became a little simpler!
>
> Of course if any Foreign Keys reference this key, you might want to go
> get a couple aspirin.
Yeah... I hear that. My script goes through and drops ALL the constraints first (in the proper order of course) then creates the necessary indexes and then re-adds the constraints.
Almost done and looking like I'll live through this.
Thanks all for the help!
>
> Brian
>
Sent via Deja.com
http://www.deja.com/
Received on Fri Jan 12 2001 - 10:17:11 CST
![]() |
![]() |