Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Antw: Question about datatypes
Hej Roland (Sverige?),
I doubt that. If all the data is number in the varchar2 column, well, you don't need it to be varchar2.
The easiest solution seems to be:
INSERT INTO newtable SELECT TO_NUMBER(col) FROM oldtable;
Premise: all your data in that column IS number. If you're not sure, do some pl/sql to identify the erroneous rows and track them in another table for correction purposes.
hth,
Guido
>>> roland.skoldblom_at_ica.se 03.11.2003 11.14 Uhr >>>
Hallo,
Maybe this sounds simple for all of you, but I have a table with the field PRICE and that is with datatype varchar2 I want the data in that field to be inserted in another table with field PRICE, but that field has the datatype NUMBER. How can I deasiest do this sql statement?
I really have to have the Varchar dataype in table1.
Thanks in advance
Roland
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Guido Konsolke INET: Guido.Konsolke_at_tkserv-triaton.thyssenkrupp.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Mon Nov 03 2003 - 04:39:24 CST
![]() |
![]() |