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: Finding non numeric values - sql

Re: Finding non numeric values - sql

From: Andy Triggs <andrew.triggs_at_businessobjects.com>
Date: 20 Nov 2002 06:06:46 -0800
Message-ID: <2b6e86d0.0211200606.70406b06@posting.google.com>


Try this:

select decode(ltrim(translate(<myvalue>, '123456789', '000000000'), '0'), null, 'NUMERIC ONLY', 'CONTAINS NON-NUMERICS') from dual;

Replace <my value> with the string you want to test beforehand.

Regards, Andy

"david.garrett" <david.garrett_at_attbi.com> wrote in message news:<MXBC9.87252$1O2.5757_at_sccrnsc04>...
> I'm trying to find a way to determine if a string holds any non numeric
> characters.
> For instance, I need to use a Decode to do one thing if a string like
> "6706A657987"
> has any non numeric characters and do another if it does not. In this
> example it has an "A" so it would need to be handled differently than say
> "6706657987". I played with Translate a little but it didn't really do the
> trick. Any suggestions?
>
> Any help is greatly appreciated.
Received on Wed Nov 20 2002 - 08:06:46 CST

Original text of this message

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