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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Sql proc

Re: Sql proc

From: sybrandb <sybrandb_at_gmail.com>
Date: Thu, 05 Jul 2007 08:47:37 -0700
Message-ID: <1183650457.445023.229810@q69g2000hsb.googlegroups.com>


On Jul 5, 3:36 pm, "Oriane" <ori..._at_guermantes.fr> wrote:
> Hi there,
>
> I want to add an new column to my tables on a precise database. This column
> (an autoincrement index for instance) will be my primary key column. The old
> one will turn into a unique colum. Of course, there are foreign keys in the
> database...
>
> Is there a "well-known" proc to make the change and migrate the database so
> as to keep the constraints, but to apply them to the new primary keys ?
>
> Regards

The well known proc is you use ALTER table ... drop constraint and ALTER table ... ADD constraint statements to DIY (Do it yourself). As the PK changes, no other solution.

--
Sybrand Bakker
Senior Oracle DBA
Received on Thu Jul 05 2007 - 10:47:37 CDT

Original text of this message

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