Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Changing datatype of a databasefield
On Fri, 27 Apr 2001 15:08:52 GMT, "Pål Jørgensen" <Paal_at_NOSPAMgdpm.no> wrote:
>I have a field in a database that is of type varchar(15) that I want
>to alter to varchar(50). Is it possible towards a Oracle-db using
>something like:
>
>Alter table TabelToAffect Alter FieldToAffect varchar(50) null
>
>Or must I :
>1) Copy the table into a temp-table
>2) Delete the old table
>3) Create the table
>4) Copy the data from the temp-db to the new table
>
>Or is it another solution ??
>
>-Pål-
>
Such and similar questions are best answered by reading the sql
manual, sv 'Alter table'
Anyway: it is alter table <tablename> modify <columnname>
and as long you don't need to make it is smaller, there is no need at all for your second 'solution'
Regards,
Sybrand Bakker, Oracle DBA Received on Fri Apr 27 2001 - 11:11:53 CDT
![]() |
![]() |