Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: changing datatype
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