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: Convert NUMBER to VARCHAR2

Re: Convert NUMBER to VARCHAR2

From: Pete Kolton <peter.kolton_at_nspmbtinternet.com>
Date: Wed, 24 Nov 1999 11:31:20 -0000
Message-ID: <81gi61$6lq$1@supernews.com>


How about...

create table b as select * from a;
truncate table a;
alter table a modify (columnname varchar2(1)); insert into a select * from b;

--



Pete Kolton
ORACLE Systems Consultant
All reasonable offers considered :-)

Pete_at_kolton.com
http://www.kolton.com


Tin Ngoc Doan wrote in message <81g9j9$s4f$1_at_mark.ucdavis.edu>...
>Hi all,
>
>Here is my situation. I've a multi-column table with data, and one of
>the columns is a NUMBER type. I need to convert it to VARCHAR2() type.
>
>What is the best way to do this?
>
>Unlike MySQL, Oracle does not handle all the copying in the background
>using the ALTER TABLE command.
>
>Appreciate your help,
>Tin
Received on Wed Nov 24 1999 - 05:31:20 CST

Original text of this message

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