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

Home -> Community -> Mailing Lists -> Oracle-L -> Can TO_NUMBER Do This?

Can TO_NUMBER Do This?

From: Ed Bittel <ebittel_at_yahoo.com>
Date: Mon, 28 Aug 2000 11:22:38 -0700 (PDT)
Message-Id: <10602.115667@fatcity.com>


Against the repeated urging of the DBA (me), a developer insisted on creating all the numeric columns of his new appliction's tables as VARCHAR2. (Don't ask me why! I've explained it to him several times to no avail.)

Problem



Negative values are represented in the tables with parenthesis (e.g., '(34,989.89)'). He needs to convert these character values to numeric so he can do some math.

I know you can parenthesize values when doing a TO_CHAR like this:

   select to_char(f1,'999D99PR') from test where f1=-123.45

   TO_CHAR(



   <123.45>

However, if this doesn't appear to work with the to_number function, at least in my case.

Any ideas how to convert at string like '(1,234.87)' to a numeric value?

-Ed



Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere! Received on Mon Aug 28 2000 - 13:22:38 CDT

Original text of this message

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