Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Finding non numeric values - sql
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
![]() |
![]() |