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: Can TO_NUMBER Do This?

Re: Can TO_NUMBER Do This?

From: Ron Rogers <RROGERS_at_galottery.org>
Date: Tue, 29 Aug 2000 13:06:50 -0400
Message-Id: <10603.115753@fatcity.com>


Other than "vain programming vanity" would anyone want to store numeric = values in a char field. Oracle still allows a minus sign in the number = field does it not? Hopefully they will write thier code more efficiently = than the storage desires.
ROR >>> jkstill_at_bcbso.com 08/29/00 11:55AM >>>

Others have told how this may be done, so I'm getting on my soapbox...

Maybe some points here you missed when 'enlightening' the developer? Have you tried a slap up the side of the head?
( not advocating that you actually do this. Well, not   very hard anyway )

NEVER store formatting with the data. This does make=20 it rather hard to reformat it in other ways. Does your developer think Oracle is a spreadsheet?

How on earth can math be easily done on such stuff? =20

Maybe the developer wants to impress others with fancy looking code that appears to do wonderful things?

Simplicity of design is elegant, unnecessary complexity is clumsy and ugly.

OK, I'll get off my soapbox now.

Jared

On Mon, 28 Aug 2000, Ed Bittel wrote:

> 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.)

>=20

> 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.=20
>=20

> I know you can parenthesize values when doing a TO_CHAR like
> this:
> select to_char(f1,'999D99PR') from test where f1=3D-123.45
>=20

> TO_CHAR(
> --------
> <123.45>
>=20

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

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

> -Ed
>=20

> __________________________________________________
> Do You Yahoo!?
> Yahoo! Mail - Free email you can access from anywhere!
> http://mail.yahoo.com/=20
> --=20
> Author: Ed Bittel
> INET: ebittel_at_yahoo.com=20
>=20

> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> 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).
>=20

Jared Still
Certified Oracle DBA and Part Time Perl Evangelist ;-) Regence BlueCross BlueShield of Oregon
jkstill_at_bcbso.com - Work - preferred address jkstill_at_teleport.com - private

--=20
Author: Jared Still
  INET: jkstill_at_bcbso.com=20

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
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 Received on Tue Aug 29 2000 - 12:06:50 CDT

Original text of this message

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