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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: To_Number

RE: To_Number

From: Kevin Lange <kgel_at_ppoone.com>
Date: Thu, 05 Dec 2002 12:06:04 -0800
Message-ID: <F001.005139CC.20021205120604@fatcity.com>


I believe its the $ and , in the data. I got the same error until I did  

select to_number(replace(replace(unit_cost,'$',''),',','')) from elas.qdr

-----Original Message-----
Sent: Thursday, December 05, 2002 1:24 PM To: Multiple recipients of list ORACLE-L

I have a table which contains a Unit_Cost varchar2(16) which contains $34,000.05. I can enter select to_number('$34,990.08','$999,999,999.99') from dual; and the results is 34990.08. However when I enter select to_number(unit_cost,'$999,999,999.99') from elas.qdr I get ora-01722: invalid number.

Is there any other way to do this? I am trying to add a varchar2 field that contains $ and commas. I thought the to_number function would convert the data to a number field.

Thanks,

Laura

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Kevin Lange
  INET: kgel_at_ppoone.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 Thu Dec 05 2002 - 14:06:04 CST

Original text of this message

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