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

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle string issue

Re: Oracle string issue

From: <chris.hulan_at_gmail.com>
Date: 16 Oct 2006 09:25:18 -0700
Message-ID: <1161015918.359585.277240@f16g2000cwb.googlegroups.com>


nilaybhagat_at_gmail.com wrote:
> Im using Oracle 9.2 and I am having trouble extracting digits from a
> string. I tried using LIKE %[0-9]% but this version does not support
> that. I also cannot use regular expressions for that same reason. Is
> there an easier way to identify digits or do I have to create a
> function to do that.
>
> Thanks!

The translate function might help:

SELECT TRANSLATE (upper('This 1 string 2 contains 3 digits 4!')

                 ,'1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ !'
                 ,'1234567890'
                 )

  FROM DUAL; Note I had include a ' ' (space) and a '!' to have those removed, similarly you'll need to add any special characters to have them removed.

HTH
Chris Received on Mon Oct 16 2006 - 11:25:18 CDT

Original text of this message

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