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: modify datatype with data?

Re: modify datatype with data?

From: Andrew Metcalfe <ametcalf_1999_at_yahoo.com>
Date: Thu, 21 Mar 2002 20:11:12 GMT
Message-ID: <3C9A3E58.E044A83A@yahoo.com>


I had thought of that. Unfortunately I want to change the datatypes of my primary keys...

Thanks,

_Am

Sybrand Bakker wrote:

> So the usual way to resolve this is
> - create an extra table consisting of the primary key of the source
> table and the affected column(s)
> - insert into select ... from source table
> - update source table set affected column = NULL
> - alter table source table modify...
> - update source table
> set affected column =
> (select affected column
> from extra table
> where extra table.primary key = source table.primary key)
>
> commit
>
> And that is basically all!
>
> Regards
>
> Sybrand Bakker, Senior Oracle DBA
>
> To reply remove -verwijderdit from my e-mail address
Received on Thu Mar 21 2002 - 14:11:12 CST

Original text of this message

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