Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Indexes and Foreign Keys
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.
>
>
>