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: changing datatype

Re: changing datatype

From: Matthias Gresz <GreMa_at_t-online.de>
Date: Mon, 18 Jan 1999 16:36:01 +0100
Message-ID: <36A354E1.DE22BC52@Privat.Post.DE>

Richard schrieb:
>
> I have a table with about 20 columns (including a long raw) and about
> 60000 rows. I want to change the datatype of one of the columns from
> number to varchar2. I understand that the column must be empty to do
> this and so tried exporting the table, clearing the table and changing
> the datatype and then, unsuccessfully, tried reimporting.
> Does anyone know if, and how, it is possible to change a datatype and
> keep the data?

Hi,

rename the original table, create a new one with the changed datatype and insert from the renamed table. Another hard work may be the reinstantiation of the foreign key and other constraints. Wasn't there a posting last year from s.o. who had a script for deleting a column? This would give a good starting point for the required handling of the constraints.

HTH
Matthias
--
Matthias.Gresz_at_Privat.Post.DE

Always log on the bright side of life.
http://www.stone-dead.asn.au/movies/life-of-brian/brian-31.htm Received on Mon Jan 18 1999 - 09:36:01 CST

Original text of this message

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