Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: modify datatype with data?
On Thu, 21 Mar 2002 19:40:02 GMT, Andrew Metcalfe
<ametcalf_1999_at_yahoo.com> wrote:
>
>Is there a mechanism in Oracle that'll allow me to modify the datatype
>of a column without disrupting the data in it?
>
>Alter table modify column is telling me the field must be empty.
>
>_Am
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
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 - 13:50:43 CST
![]() |
![]() |