Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Indexes and Foreign Keys

Re: Indexes and Foreign Keys

From: Dereck L. Dietz <dietzdl_at_ameritech.net>
Date: Sun, 12 Mar 2006 14:43:30 GMT
Message-ID: <msWQf.38080$_S7.11226@newssvr14.news.prodigy.com>


I've always worked with the assumption that primary keys aren't changed. If you need to change the primary key of a record then maybe it shouldn't be a primary key.

I have designed a number of tables where I find out the field that should be the primary key could be changed so I just create a unique index on it to keep from getting duplicates. Then I add a row which is nothing more than a numeric sequence and use that to link the parent with any children records.

Not sure how "professional" that is but it keeps the parent-child relationship together and lets other fields in the table be changed as needed.

"Frank van Bortel" <frank.van.bortel_at_gmail.com> wrote in message news:dv0uc4$6c1$1_at_news3.zwoll1.ov.home.nl...
> ianal Vista wrote:
> > "Mark A" <nobody_at_nowhere.com> wrote in
> > news:fKidnQReWuI7xY7ZnZ2dnUVZ_s-dnZ2d_at_comcast.com:
> >
> >> "ianal Vista" <ianal_vista_at_hotmail.com> wrote in message
> >> news:Xns978399CB1E357ianalvistahotmailcom_at_70.169.32.36...
> >>> Hmmm...
> >>>
> >>> I am/was under the opinion that the PK values can NEVER be changed.
> >>>
> >> Some do, some don't.
> >
> > Please provide functioning SQL example that "changes" a PK value.

>

> Of course they can; however, it points to either an incorrect analysis,
> or some cutting corners when implementing the (correct) design.
> Whether this corner cutting is simply deue to technical constraints
> of the make/model to the DBMS chosen, I cannot answer.
>

> I'd vote for "primary keys should not have a need to be altered".
>

> Hmmmmm, how politically correct can you get?
> --
> Regards,
> Frank van Bortel

>
> Top-posting is one way to shut me up...
Received on Sun Mar 12 2006 - 08:43:30 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US