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: change the primary key

Re: change the primary key

From: Davide Bianchi <davidebianchi_at_davidebianchi.net>
Date: Mon, 10 Sep 2001 11:12:26 +0200
Message-ID: <9ni06q$7fgi5$1@ID-18487.news.dfncis.de>


"flora" <jadewind_at_tigtag.com> wrote in message news:3b9907d7_at_dnews.tpgi.com.au...
> in oracle7, using sql*plus, if i want to change the primary
> key how can i do that?

  1. locate all the tables that have foreign keys pointing to the table that you want to modify, drop all those constraints.
  2. drop the constraint on the table
  3. drop the field
  4. create the new field/fields
  5. create the new constraint
  6. create new FOREIGN KEYS for all the related tables.

Davide Received on Mon Sep 10 2001 - 04:12:26 CDT

Original text of this message

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