Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Changing datatype of a databasefield

Re: Changing datatype of a databasefield

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 27 Apr 2001 18:11:53 +0200
Message-ID: <ee6jet00pkj5a3ihlrvcthhqtoopdp65sh@4ax.com>

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

Original text of this message

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