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: SQL question, updating all rows

Re: SQL question, updating all rows

From: michael ringbo <mri_at_dde-nospam.dk>
Date: Tue, 16 Jun 1998 09:29:09 +0200
Message-ID: <35861EC5.E19B5080@dde-nospam.dk>


Hi

The quick, dirty and one-timer procedure could be to:

1. add the new column (NEW_COL)
2. update the column with rownum: UPDATE MY_TAB SET NEW_COL = ROWNUM;
3. Make the column not null
4. alter your pk-constraint

Regards,

Michael Ringbo, DDE A/S

Zahi Al-Jamous wrote:

> Hello,
>
> I have a table where I added a column, and I want this column to be
> the primary key of my table. I need then to update this column,
> adding a unique value for each row of my table.
> Can someone tell me how i can do this in SQL ?
>
> TIA,
>
> Zahi
> --
> Zahi Al-Jamous e-mail: aljamous_at_crv.pechiney.fr
> Groupe GIL
> Pechiney-CRV
> BP 27 tel (work): +33.(0)4.76.57.82.45
> F-38340 Voreppe tel (cell): +33.(0)6.14.55.16.88

--
to reply, remove the "-nospam" from the address Received on Tue Jun 16 1998 - 02:29:09 CDT

Original text of this message

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